Files
Erupe/Dockerfile
Houmgaor 7d54dd0ee6 ci: add Docker CD workflow to push images to GHCR
Multi-stage Dockerfile for smaller runtime image, CD workflow triggers
on main branch pushes and version tags, docker-compose defaults to the
prebuilt GHCR image.
2026-02-17 00:28:37 +01:00

30 lines
594 B
Docker

# Build stage
FROM golang:1.25-alpine3.21 AS builder
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o erupe-ce .
# Runtime stage
FROM alpine:3.21
RUN adduser -D -h /app erupe
WORKDIR /app
COPY --from=builder /build/erupe-ce .
COPY --from=builder /build/www/ ./www/
COPY --from=builder /build/schemas/ ./schemas/
# bundled-schema/ is optional demo data, copy if present
RUN mkdir -p bundled-schema
# bin/ and savedata/ are mounted at runtime via docker-compose
# config.json is also mounted at runtime
USER erupe
ENTRYPOINT ["./erupe-ce"]