1
1
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-10 12:51:01 +02:00
schollz_croc/Dockerfile

28 lines
495 B
Docker

FROM golang:1.24-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 9009
EXPOSE 9010
EXPOSE 9011
EXPOSE 9012
EXPOSE 9013
COPY --from=builder /go/croc/croc /go/croc/croc-entrypoint.sh /
USER nobody
# Simple TCP health check with nc!
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD nc -z localhost 9009 || exit 1
ENTRYPOINT ["/croc-entrypoint.sh"]
CMD ["relay"]