mirror of
https://github.com/tiennm99/miti99bot.git
synced 2026-07-23 16:22:13 +00:00
22 lines
536 B
Docker
22 lines
536 B
Docker
FROM golang:1.25-alpine AS builder
|
|
WORKDIR /src
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
# The deploy-notify commit SHA comes from Coolify's SOURCE_COMMIT runtime env,
|
|
# not from a build arg. Keep it out of the build so Docker cache survives across
|
|
# commits. The binary is built plain.
|
|
RUN CGO_ENABLED=0 GOOS=linux go build \
|
|
-ldflags="-s -w" \
|
|
-o /out/server \
|
|
./cmd/server
|
|
|
|
FROM gcr.io/distroless/static:nonroot
|
|
COPY --from=builder /out/server /server
|
|
USER nonroot:nonroot
|
|
EXPOSE 8080
|
|
ENTRYPOINT ["/server"]
|