mirror of
https://github.com/usememos/memos.git
synced 2024-11-24 14:42:58 +03:00
chore: update dockerfile
This commit is contained in:
parent
d665adf78b
commit
f9f2f549af
24
Dockerfile
24
Dockerfile
@ -1,16 +1,22 @@
|
|||||||
|
# Build protobuf.
|
||||||
|
FROM golang:1.21-alpine AS protobuf
|
||||||
|
WORKDIR /protobuf-generate
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
RUN GO111MODULE=on GOBIN=/usr/local/bin go install github.com/bufbuild/buf/cmd/buf@v1.26.1
|
||||||
|
|
||||||
|
WORKDIR /protobuf-generate/proto
|
||||||
|
|
||||||
|
RUN buf generate
|
||||||
|
|
||||||
# Build frontend dist.
|
# Build frontend dist.
|
||||||
FROM node:18-alpine AS frontend
|
FROM node:18-alpine AS frontend
|
||||||
WORKDIR /frontend-build
|
WORKDIR /frontend-build
|
||||||
|
|
||||||
COPY . .
|
COPY ./web .
|
||||||
|
|
||||||
WORKDIR /frontend-build/proto
|
COPY --from=protobuf /protobuf-generate/web/src/types/proto ./src/types/proto
|
||||||
|
|
||||||
RUN npm i -g @bufbuild/buf
|
|
||||||
|
|
||||||
RUN buf generate
|
|
||||||
|
|
||||||
WORKDIR /frontend-build/web
|
|
||||||
|
|
||||||
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
|
|||||||
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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user