Files
Extrudex/backend/Dockerfile
dex-bot 3fe0850711
Some checks failed
Dev Build / build-test (pull_request) Failing after 1m39s
CUB-112: scaffold Go backend with Chi, pgx, health check
2026-05-06 12:20:31 -04:00

26 lines
421 B
Docker

# Build stage
FROM golang:1.24-alpine AS builder
WORKDIR /app
# Copy go mod files first for caching
COPY go.mod go.sum ./
RUN go mod download
# Copy source and build
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o server ./cmd/server
# Final stage
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
# Copy binary from builder
COPY --from=builder /app/server .
EXPOSE 8080
CMD ["./server"]