diff options
author | Santo Cariotti <santo@dcariotti.me> | 2025-04-22 09:39:17 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2025-04-22 09:39:17 +0200 |
commit | d9dfabe75e4edb7fe2f32cb9a42113a529f52bf6 (patch) | |
tree | 64aaa67b55628dc7120ba6a140b49b2d5ed4bdb8 /docker/api/Dockerfile | |
parent | 2ce3cb9fdb90847a33106c61708f516ea6ca932a (diff) |
Add Docker
Diffstat (limited to 'docker/api/Dockerfile')
-rw-r--r-- | docker/api/Dockerfile | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/docker/api/Dockerfile b/docker/api/Dockerfile new file mode 100644 index 0000000..c92d35a --- /dev/null +++ b/docker/api/Dockerfile @@ -0,0 +1,22 @@ +FROM golang:alpine AS builder + +RUN apk --update add ca-certificates git + +WORKDIR /app + +COPY . . +RUN go mod download + +RUN CGO_ENABLED=0 GOOS=linux go build cmd/api/main.go + +# Run the exe file +FROM scratch + +WORKDIR /app + +COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt +COPY --from=builder /app . + +EXPOSE 8080 + +CMD ["./main"] |