Files
apocapoc-api/Dockerfile
T
david a71c5a6d76 Add Docker deployment support
- Create Dockerfile with multi-stage build for optimized image size
- Add GitHub Actions workflow for automatic image publishing to ghcr.io
- Add PORT and HOST fallback defaults in config (8080 and 0.0.0.0)
- Update README with Docker Compose installation instructions
2025-11-26 17:38:51 +01:00

23 lines
407 B
Docker

FROM golang:1.24-alpine AS builder
RUN apk add --no-cache gcc musl-dev sqlite-dev
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 GOOS=linux go build -a -installsuffix cgo -o apocapoc-api cmd/api/main.go
FROM alpine:latest
RUN apk --no-cache add ca-certificates sqlite-libs
WORKDIR /root/
COPY --from=builder /app/apocapoc-api .
EXPOSE 8080
CMD ["./apocapoc-api"]