chore: update dockerfile
This commit is contained in:
parent
0f965c6fe0
commit
e41916408a
1 changed files with 5 additions and 3 deletions
|
|
@ -1,11 +1,13 @@
|
||||||
FROM golang:1.24-alpine AS backend
|
FROM golang:1.24-alpine AS backend
|
||||||
WORKDIR /backend-build
|
WORKDIR /backend-build
|
||||||
|
COPY go.mod go.sum ./
|
||||||
|
RUN go mod download
|
||||||
COPY . .
|
COPY . .
|
||||||
# Please build frontend first, so that the static files are available.
|
# Please build frontend first, so that the static files are available.
|
||||||
# Refer to `pnpm release` in package.json for the build command.
|
# Refer to `pnpm release` in package.json for the build command.
|
||||||
|
RUN --mount=type=cache,target=/go/pkg/mod \
|
||||||
RUN go build -o memos ./bin/memos/main.go
|
--mount=type=cache,target=/root/.cache/go-build \
|
||||||
|
go build -ldflags="-s -w" -o memos ./bin/memos/main.go
|
||||||
|
|
||||||
# Make workspace with above generated files.
|
# Make workspace with above generated files.
|
||||||
FROM alpine:latest AS monolithic
|
FROM alpine:latest AS monolithic
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue