Add Dockerfile and docker-compose.yaml

This commit is contained in:
2023-03-28 22:25:11 +03:00
parent 427bc63884
commit 9262249ea1
3 changed files with 44 additions and 0 deletions

15
.dockerignore Normal file
View File

@@ -0,0 +1,15 @@
.idea
*~
.fuse_hidden*
.directory
.Trash-*
.nfs*
*.exe
*.exe~
*.dll
*.so
*.dylib
*.test
*.out
go.work
db

13
Dockerfile Normal file
View File

@@ -0,0 +1,13 @@
FROM golang:1.20-alpine as builder
WORKDIR /project
ADD go.* ./
RUN go mod download
ADD . .
RUN CGO_ENABLED=0 go build -o service ./cmd/service/main.go
FROM surnet/alpine-wkhtmltopdf:3.17.0-0.12.6-full
WORKDIR /project
COPY --from=builder /project/service service
ENTRYPOINT ["./service"]

16
docker-compose.yaml Normal file
View File

@@ -0,0 +1,16 @@
version: "3"
services:
webarchive:
build:
dockerfile: ./Dockerfile
context: .
environment:
LOGGING_DEBUG: true
API_ADDRESS: 0.0.0.0:5001
PDF_DPI: 300
DB_PATH: /db
volumes:
- ./db:/db
ports:
- "0.0.0.0:5002:5001"