Files
assetx/webapp-back/Dockerfile

17 lines
392 B
Docker
Raw Permalink Normal View History

# ---- Build stage ----
FROM golang:1.24-alpine AS builder
WORKDIR /app
RUN apk add --no-cache git gcc musl-dev
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o server .
# ---- Run stage ----
FROM alpine:3.21
WORKDIR /app
RUN apk add --no-cache ca-certificates tzdata
COPY --from=builder /app/server .
EXPOSE 8080
CMD ["./server"]