mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 15:43:49 +01:00
- Add multi-stage build to Dockerfile for smaller production image - Move docker-compose.yml to project root for easier usage - Flatten docker/init/setup.sh to docker/setup.sh - Expand .dockerignore to exclude unnecessary files - Remove deprecated version field from compose files
28 lines
415 B
Docker
28 lines
415 B
Docker
# Build stage
|
|
FROM golang:1.25-alpine3.21 AS builder
|
|
|
|
ENV GO111MODULE=on
|
|
|
|
WORKDIR /app/erupe
|
|
|
|
COPY go.mod .
|
|
COPY go.sum .
|
|
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -o erupe-ce .
|
|
|
|
# Runtime stage
|
|
FROM alpine:3.21
|
|
|
|
RUN apk --no-cache add ca-certificates tzdata
|
|
|
|
WORKDIR /app/erupe
|
|
|
|
COPY --from=builder /app/erupe/erupe-ce .
|
|
|
|
# Default command runs the compiled binary
|
|
CMD [ "./erupe-ce" ]
|