build: add docker setup

This commit is contained in:
2025-12-24 17:05:14 -03:00
parent 6f419ece3d
commit a82adb90c2
2 changed files with 43 additions and 0 deletions

20
Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
FROM golang:1.25.3-alpine AS builder
WORKDIR /app
COPY . .
# Build
RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux go build -a -o main ./cmd/server
###########
FROM alpine:3.22.2
RUN apk --no-cache add ca-certificates
WORKDIR /root/
# Copy the pre-built binary
COPY --from=builder /app/main .
EXPOSE 8080
CMD ["./main"]