mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-05-14 03:01:48 +00:00
Add a Dockerfile
This commit is contained in:
committed by
Catherine
parent
9c0cdaa2eb
commit
bffa79dfba
18
Dockerfile
Normal file
18
Dockerfile
Normal 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
9
docker-compose.yml
Normal 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
|
||||
Reference in New Issue
Block a user