deploy configuration
This commit is contained in:
parent
9ba3c47d82
commit
dac02c61c3
45 changed files with 1405 additions and 582 deletions
13
Dockerfile
13
Dockerfile
|
|
@ -9,18 +9,19 @@ RUN npm run build -- --outDir /src/ui/dist --emptyOutDir
|
|||
# Compile the Go binary with the built frontend embedded.
|
||||
FROM golang:1.27-alpine AS backend
|
||||
WORKDIR /src
|
||||
COPY go.mod ./
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY cmd/ ./cmd/
|
||||
COPY internal/ ./internal/
|
||||
COPY --from=ui /src/ui/dist/ ./cmd/server/web/dist/
|
||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/cms ./cmd/server
|
||||
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/go-tell ./cmd/server
|
||||
|
||||
# Runtime: one static binary, no database, no shell tooling.
|
||||
FROM alpine:3.20
|
||||
RUN apk add --no-cache ca-certificates tzdata \
|
||||
&& adduser -D -u 10001 cms
|
||||
COPY --from=backend /out/cms /usr/local/bin/cms
|
||||
USER cms
|
||||
&& adduser -D -u 10001 go-tell
|
||||
COPY --from=backend /out/go-tell /usr/local/bin/go-tell
|
||||
USER go-tell
|
||||
EXPOSE 8080
|
||||
ENV CMS_HTTP_ADDR=:8080
|
||||
# Mount a volume here and set CMS_CONTENT_FILE=/data/content.json to keep edits
|
||||
|
|
@ -28,4 +29,4 @@ ENV CMS_HTTP_ADDR=:8080
|
|||
VOLUME ["/data"]
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s \
|
||||
CMD wget -qO- http://127.0.0.1:8080/health || exit 1
|
||||
ENTRYPOINT ["/usr/local/bin/cms"]
|
||||
ENTRYPOINT ["/usr/local/bin/go-tell"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue