feat: Add Docker support

This commit is contained in:
ptrcnull 2021-06-10 22:33:32 +02:00
parent dfaa95e05a
commit bcb7200ebf
2 changed files with 28 additions and 0 deletions

20
Dockerfile Normal file
View file

@ -0,0 +1,20 @@
FROM golang:alpine as builder
LABEL maintainer="ptrcnull <docker@ptrcnull.me>"
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY main.go .
COPY utils ./utils
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o server main.go
FROM scratch
WORKDIR /app
COPY --from=builder /src/server .
CMD ["/app/server"]

8
docker-compose.yml Normal file
View file

@ -0,0 +1,8 @@
version: '3'
services:
pkgs:
container_name: pkgs
build: .
restart: always
ports:
- 127.0.0.1:8212:8080