File size: 413 Bytes
4367287 b65426a 4367287 b65426a 4367287 b65426a 4367287 3b9a1cf 4367287 b65426a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# Build stage
FROM golang:1.24-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o main .
# Final stage
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /app
COPY --from=builder /app/main .
# Labels
LABEL maintainer="z2"
LABEL description="z2 API"
LABEL version="1.0.5"
# Expose port
EXPOSE 7860
# Run the application
CMD ["./main"] |