+33
@@ -0,0 +1,33 @@
|
||||
FROM docker.io/library/golang:1.26-alpine AS build
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
FROM build AS api-build
|
||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/api ./cmd/api
|
||||
|
||||
FROM build AS web-build
|
||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/web ./cmd/web
|
||||
|
||||
FROM docker.io/library/alpine:3.22 AS runtime
|
||||
|
||||
RUN apk add --no-cache ca-certificates \
|
||||
&& addgroup -S gardomatic \
|
||||
&& adduser -S -G gardomatic gardomatic
|
||||
|
||||
WORKDIR /app
|
||||
USER gardomatic
|
||||
|
||||
FROM runtime AS api
|
||||
COPY --from=api-build /out/api /app/api
|
||||
EXPOSE 4000
|
||||
ENTRYPOINT ["/app/api"]
|
||||
|
||||
FROM runtime AS web
|
||||
COPY --from=web-build /out/web /app/web
|
||||
EXPOSE 4040
|
||||
ENTRYPOINT ["/app/web"]
|
||||
Reference in New Issue
Block a user