-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (27 loc) · 948 Bytes
/
Dockerfile
File metadata and controls
31 lines (27 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM node:20 AS web
WORKDIR /app/web
COPY web/package.json web/package-lock.json* ./
RUN npm install
COPY web/ ./
RUN npm run build
FROM golang:1.25 AS backend
WORKDIR /app
ARG VERSION=dev
ARG GIT_COMMIT=unknown
ARG BUILD_TIME=unknown
COPY go.mod go.sum ./
RUN go mod download
COPY . .
COPY --from=web /app/web/_site ./web/_site
RUN CGO_ENABLED=0 GOOS=linux go build \
-ldflags="-s -w -X github.com/dustin/Caddystat/internal/version.Version=${VERSION} \
-X github.com/dustin/Caddystat/internal/version.GitCommit=${GIT_COMMIT} \
-X github.com/dustin/Caddystat/internal/version.BuildTime=${BUILD_TIME}" \
-o /bin/caddystat ./cmd/caddystat
FROM gcr.io/distroless/base-debian12
COPY --from=backend /bin/caddystat /bin/caddystat
COPY --from=backend /app/web/_site /web/_site
EXPOSE 8404
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD ["/bin/caddystat", "--healthcheck"]
ENTRYPOINT ["/bin/caddystat"]