Files
Control-plane/dockerfile
T
2026-06-14 03:09:44 +03:00

23 lines
517 B
Docker

FROM golang:1.26.1 as builder
WORKDIR /app
COPY . .
ENV CGO_ENABLED=0
ENV GIN_MODE=release
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go mod download && \
go build -ldflags "-s -w" -o backend ./cmd/main.go
FROM alpine:3.23.0
RUN apk add --no-cache curl openssl bash
COPY --from=builder /app/backend .
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD [ "curl --fail http://localhost:8080/health" ]
CMD ["./backend"]