Add a Dockerfile

This commit is contained in:
Markus Unterwaditzer
2025-09-15 20:26:07 +02:00
committed by Catherine
parent 9c0cdaa2eb
commit bffa79dfba
2 changed files with 27 additions and 0 deletions

18
Dockerfile Normal file
View File

@@ -0,0 +1,18 @@
FROM golang:1.24-alpine AS builder
RUN apk add --no-cache git
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY src/ ./src/
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o git-pages ./src
FROM alpine:latest
RUN apk --no-cache add ca-certificates git
RUN addgroup -g 1000 -S appuser && \
adduser -u 1000 -S appuser -G appuser
WORKDIR /app
COPY --from=builder /app/git-pages .
USER appuser
EXPOSE 3333
CMD ["./git-pages"]

9
docker-compose.yml Normal file
View File

@@ -0,0 +1,9 @@
git-pages:
build:
context: https://codeberg.org/whitequark/git-pages.git
dockerfile: ./Dockerfile
restart: always
user: "1000:1000"
volumes:
- ./git-pages/config.toml:/app/config.toml
- ./git-pages/data:/data