Skip to content

Commit e419164

Browse files
committed
chore: update dockerfile
1 parent 0f965c6 commit e419164

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
FROM golang:1.24-alpine AS backend
22
WORKDIR /backend-build
3-
3+
COPY go.mod go.sum ./
4+
RUN go mod download
45
COPY . .
56
# Please build frontend first, so that the static files are available.
67
# Refer to `pnpm release` in package.json for the build command.
7-
8-
RUN go build -o memos ./bin/memos/main.go
8+
RUN --mount=type=cache,target=/go/pkg/mod \
9+
--mount=type=cache,target=/root/.cache/go-build \
10+
go build -ldflags="-s -w" -o memos ./bin/memos/main.go
911

1012
# Make workspace with above generated files.
1113
FROM alpine:latest AS monolithic

0 commit comments

Comments
 (0)