-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (23 loc) · 894 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (23 loc) · 894 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
34
35
# ---- Build stage ----
FROM golang:1.22-alpine AS builder
WORKDIR /app
# Download dependencies (cached layer)
COPY go.mod go.sum ./
RUN go mod download
# Copy source and assets
COPY . .
# Compile static binary
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /gameshelf ./cmd/gameshelf
# ---- Runtime stage ----
FROM alpine:latest
LABEL org.opencontainers.image.source=https://github.com/aa-replicated/GameShelf
# Install CA certificates for HTTPS (if ever needed) and timezone data
RUN apk --no-cache add ca-certificates tzdata
WORKDIR /app
# Copy binary from builder
COPY --from=builder /gameshelf /app/gameshelf
# All templates/static/migrations are embedded in the binary — no extra COPY needed
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget -qO- http://localhost:8080/healthz || exit 1
ENTRYPOINT ["/app/gameshelf"]