zapi / Dockerfile
sanbo
update sth at 2025-10-10 01:03:22
3b9a1cf
raw
history blame contribute delete
413 Bytes
# 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"]