-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (30 loc) · 779 Bytes
/
Copy pathDockerfile
File metadata and controls
41 lines (30 loc) · 779 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
34
35
36
37
38
39
40
41
FROM golang:1.25-alpine AS builder
RUN apk add --no-cache git gcc musl-dev
WORKDIR /go/croc
COPY . .
RUN go build -v -ldflags="-s -w"
FROM alpine:latest
EXPOSE 8080
EXPOSE 9009
EXPOSE 9010
EXPOSE 9011
EXPOSE 9012
EXPOSE 9013
EXPOSE 9014
EXPOSE 9015
EXPOSE 9016
EXPOSE 9017
COPY --from=builder /go/croc/croc /go/croc/croc-entrypoint.sh /
RUN mkdir -p /www/croc/storage \
&& chown -R nobody:nobody /www/croc
USER nobody
# Simple TCP health check with nc!
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD sh -c ' \
P="${CROC_RELAY_PORTS:-${CROC_PORTS:-${CROC_PORT:-9009}}}"; \
IFS=,; set -- $P; \
for p in "$@"; do \
nc -z -w 3 localhost "$p" || exit 1; \
done'
ENTRYPOINT ["/croc-entrypoint.sh"]
CMD ["relay"]