Files
doormile_backend/Dockerfile
2026-07-04 11:10:52 +05:30

22 lines
455 B
Docker

# First Stage: Build the binary using golang base image
FROM golang:1.25
RUN mkdir /app
ADD . /app/
WORKDIR /app
RUN CGO_ENABLED=0 GOOS=linux go build -o server .
# Second Stage: Run the compiled binary inside alpine
FROM alpine
# Fix: Alpine needs ca-certificates to verify SSL certificates
RUN apk add --no-cache ca-certificates
# Copy from first stage
COPY --from=0 /app/server /app/server
WORKDIR /app
# Default startup command
CMD ["./server"]