|
|
@ -1,21 +1,9 @@
|
|
|
|
# Build frontend dist.
|
|
|
|
|
|
|
|
FROM node:20-alpine AS frontend
|
|
|
|
|
|
|
|
WORKDIR /frontend-build
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WORKDIR /frontend-build/web
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RUN npm install -g pnpm
|
|
|
|
|
|
|
|
RUN pnpm i --frozen-lockfile
|
|
|
|
|
|
|
|
RUN pnpm build
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Build backend exec file.
|
|
|
|
|
|
|
|
FROM golang:1.24-alpine AS backend
|
|
|
|
FROM golang:1.24-alpine AS backend
|
|
|
|
WORKDIR /backend-build
|
|
|
|
WORKDIR /backend-build
|
|
|
|
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
COPY . .
|
|
|
|
COPY --from=frontend /frontend-build/web/dist /backend-build/server/router/frontend/dist
|
|
|
|
# Please build frontend first, so that the static files are available.
|
|
|
|
|
|
|
|
# Refer to `pnpm release` in package.json for the build command.
|
|
|
|
|
|
|
|
|
|
|
|
RUN go build -o memos ./bin/memos/main.go
|
|
|
|
RUN go build -o memos ./bin/memos/main.go
|
|
|
|
|
|
|
|
|
|
|
|