forked from XxxXTeam/geminiweb2api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (19 loc) · 877 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (19 loc) · 877 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
30
31
32
33
FROM golang:1.25-alpine AS builder
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o /out/geminiweb2api ./cmd/geminiweb2api
FROM alpine:3.21
WORKDIR /app
RUN apk add --no-cache ca-certificates tzdata wget su-exec && update-ca-certificates \
&& addgroup -S app && adduser -S -G app app \
&& mkdir -p /app && chown -R app:app /app
COPY --from=builder /out/geminiweb2api /app/geminiweb2api
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chown app:app /app/geminiweb2api \
&& chmod +x /usr/local/bin/docker-entrypoint.sh
EXPOSE 8080
VOLUME ["/app"]
HEALTHCHECK --interval=30s --timeout=10s --start-period=45s --retries=3 CMD sh -c 'wget -q -O /dev/null http://127.0.0.1:8080/api/telemetry || exit 1'
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]