-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (22 loc) · 790 Bytes
/
Dockerfile
File metadata and controls
29 lines (22 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM golang:1.25-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o gipi ./cmd/gipi/main.go
RUN CGO_ENABLED=0 GOOS=linux go build -o healthcheck healthcheck.go
RUN go install github.com/swaggo/swag/cmd/swag@latest
RUN swag init -g cmd/gipi/main.go
FROM scratch
ENV GIN_MODE=release
WORKDIR /app
COPY --from=builder /app/gipi .
COPY --from=builder /app/healthcheck .
COPY --from=builder --chown=1000:1000 /app/docs ./docs
COPY --from=builder --chown=1000:1000 /app/web ./web
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
EXPOSE 8080
VOLUME [ "/app/data" ]
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD ["/app/healthcheck","--port","8080"]
CMD ["./gipi"]