From db23a8575748fdc63d2a496fb5965d2239ba05ef Mon Sep 17 00:00:00 2001 From: Viktor45 Date: Sat, 3 Aug 2024 14:24:31 +0300 Subject: [PATCH 1/2] Create Dockerfile Add simple Dockerfile for latest version --- Dockerfile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c2680e8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM golang:alpine + +WORKDIR /go + +RUN go install github.com/xvzc/SpoofDPI/cmd/spoof-dpi@latest + +ENV ADDRESS=0.0.0.0 + +ENV DNS=1.1.1.1 + +ENV PORT=8080 + +ENV DEBUG=false + +ENV NO_BANNER=true + +ENV TIMEOUT=500 + +ENV URLS= + +ENV PATTERN= + +ENV WINDOW_SIZE=0 + +EXPOSE 8080 + +CMD ["/bin/sh", "-c", "/go/bin/spoof-dpi -addr=${ADDRESS} -debug=${DEBUG} -dns-addr=${DNS} -port=${PORT} -no-banner=${NO_BANNER} -timeout=${TIMEOUT} -window-size=${WINDOW_SIZE} $(echo \"${URLS}\" | tr -d ' ' | tr ',' '\n' | sed -e 's/^/-url=/') -pattern ${PATTERN}"] From 3f90cd3bbff48c24014de6b63289f58decea3147 Mon Sep 17 00:00:00 2001 From: Viktor45 Date: Mon, 5 Aug 2024 18:20:26 +0300 Subject: [PATCH 2/2] Update Dockerfile Better simple Dockerfile ``` $ docker build ./ -t spoof-dpi:latest $ docker run -ti spoof-dpi:latest spoof-dpi --timeout 2000 --debug ``` --- Dockerfile | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index c2680e8..39ad95a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,27 +1,13 @@ -FROM golang:alpine +FROM golang:alpine as builder WORKDIR /go RUN go install github.com/xvzc/SpoofDPI/cmd/spoof-dpi@latest -ENV ADDRESS=0.0.0.0 +FROM alpine:latest -ENV DNS=1.1.1.1 +WORKDIR / -ENV PORT=8080 +COPY --from=builder /go/bin/spoof-dpi . -ENV DEBUG=false - -ENV NO_BANNER=true - -ENV TIMEOUT=500 - -ENV URLS= - -ENV PATTERN= - -ENV WINDOW_SIZE=0 - -EXPOSE 8080 - -CMD ["/bin/sh", "-c", "/go/bin/spoof-dpi -addr=${ADDRESS} -debug=${DEBUG} -dns-addr=${DNS} -port=${PORT} -no-banner=${NO_BANNER} -timeout=${TIMEOUT} -window-size=${WINDOW_SIZE} $(echo \"${URLS}\" | tr -d ' ' | tr ',' '\n' | sed -e 's/^/-url=/') -pattern ${PATTERN}"] +ENTRYPOINT ["./spoof-dpi"]