contrib: docker support (#20)

This commit is contained in:
Gil Poiares-Oliveira 2023-02-14 18:32:49 +00:00 committed by GitHub
parent 22cf7a4a89
commit c90b2b5193
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 0 deletions

25
contrib/Dockerfile Normal file
View File

@ -0,0 +1,25 @@
FROM golang:1.19-alpine AS builder
WORKDIR /app
COPY . ./
RUN apk add gcc musl-dev libc-dev
RUN go mod download
RUN go mod verify
RUN go build -o legit
FROM alpine:latest
WORKDIR /app
COPY static ./static
COPY templates ./templates
COPY config.yaml ./
COPY --from=builder /app/legit ./
EXPOSE 5555
CMD ["./legit"]

View File

@ -0,0 +1,15 @@
version: "3"
services:
legit:
container_name: legit
build:
context: ../
dockerfile: ../contrib/Dockerfile
restart: unless-stopped
ports:
- "5555:5555"
volumes:
- /var/www/git:/var/www/git
- ../config.yaml:/app/config.yaml
- ../static:/app/static
- ../templates:/app/templates