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
This commit is contained in:
2025-11-26 17:38:51 +01:00
parent 9f673bfca3
commit a71c5a6d76
4 changed files with 116 additions and 8 deletions
+22
View File
@@ -0,0 +1,22 @@
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"]