forked from GreyhavenHQ/greyproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (25 loc) · 870 Bytes
/
Dockerfile
File metadata and controls
42 lines (25 loc) · 870 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
42
FROM --platform=$BUILDPLATFORM tonistiigi/xx:1.6.1 AS xx
FROM --platform=$BUILDPLATFORM golang:1.25-alpine3.22 AS builder
# add upx for binary compression
RUN apk add --no-cache upx || echo "upx not found"
COPY --from=xx / /
ARG TARGETPLATFORM
RUN xx-info env
ENV CGO_ENABLED=0
ENV XX_VERIFY_STATIC=1
WORKDIR /app
COPY . .
RUN cd cmd/greyproxy && \
xx-go build -ldflags "-s -w" && \
xx-verify greyproxy && \
{ upx --best greyproxy || true; }
FROM alpine:3.22
LABEL org.opencontainers.image.source="https://github.com/greyhavenhq/greyproxy"
# add iptables for tun/tap
RUN apk add --no-cache iptables
WORKDIR /bin/
COPY --from=builder /app/cmd/greyproxy/greyproxy .
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget -qO- http://localhost:43080/api/health || exit 1
ENTRYPOINT ["/bin/greyproxy"]
CMD ["serve"]