feat(container): Dockerfile

This commit is contained in:
Nicolai Ort 2024-12-03 18:05:45 +01:00
parent bd70ac4542
commit d51e78a442
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F
2 changed files with 17 additions and 0 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
tmp
docker-compose.yaml
.air.toml

14
Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM golang:1.23-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o server
FROM scratch
COPY --from=builder /app/server /server
ADD https://curl.haxx.se/ca/cacert.pem /etc/ssl/certs/ca-certificates.crt
ENTRYPOINT [ "/server" ]