-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.dev
More file actions
33 lines (21 loc) · 702 Bytes
/
Dockerfile.dev
File metadata and controls
33 lines (21 loc) · 702 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
32
33
FROM golang:1.26-alpine AS backend
RUN apk add --no-cache git
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/server ./cmd/server
FROM alpine:3.20
WORKDIR /app
RUN apk add --no-cache ca-certificates tzdata wget && \
addgroup -S app && \
adduser -S app -G app && \
mkdir -p /data /data/certificates && \
chown -R app:app /app /data
COPY --from=backend /out/server /app/server
RUN chmod +x /app/server
USER app
EXPOSE 8080 80 443
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=5 \
CMD wget -qO- http://127.0.0.1:8080/readyz >/dev/null || exit 1
ENTRYPOINT ["/app/server"]