Commit f9f2f549 authored by Steven's avatar Steven

chore: update dockerfile

parent d665adf7
# Build frontend dist. # Build protobuf.
FROM node:18-alpine AS frontend FROM golang:1.21-alpine AS protobuf
WORKDIR /frontend-build WORKDIR /protobuf-generate
COPY . . COPY . .
WORKDIR /frontend-build/proto RUN GO111MODULE=on GOBIN=/usr/local/bin go install github.com/bufbuild/buf/cmd/buf@v1.26.1
RUN npm i -g @bufbuild/buf WORKDIR /protobuf-generate/proto
RUN buf generate RUN buf generate
WORKDIR /frontend-build/web # Build frontend dist.
FROM node:18-alpine AS frontend
WORKDIR /frontend-build
COPY ./web .
COPY --from=protobuf /protobuf-generate/web/src/types/proto ./src/types/proto
RUN corepack enable && pnpm i --frozen-lockfile RUN corepack enable && pnpm i --frozen-lockfile
...@@ -21,7 +27,7 @@ FROM golang:1.21-alpine AS backend ...@@ -21,7 +27,7 @@ FROM golang:1.21-alpine AS backend
WORKDIR /backend-build WORKDIR /backend-build
COPY . . COPY . .
COPY --from=frontend /frontend-build/web/dist ./server/dist COPY --from=frontend /frontend-build/dist ./server/dist
RUN CGO_ENABLED=0 go build -o memos ./main.go RUN CGO_ENABLED=0 go build -o memos ./main.go
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment