Yimaru-BackEnd/Dockerfile
2025-08-01 20:14:25 +03:00

18 lines
362 B
Docker

# Builder stage
FROM golang:1.24-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -ldflags="-s -w" -o ./bin/web ./cmd/main.go
# Runner stage
FROM alpine:3.21 AS runner
WORKDIR /app
COPY .env .
COPY --from=builder /app/bin/web /app/bin/web
RUN apk add --no-cache ca-certificates
EXPOSE ${PORT}
CMD ["/app/bin/web"]