From cdff9b7dd058691985e6ffc73f2a063d3264032a Mon Sep 17 00:00:00 2001 From: qzheng Date: Thu, 12 Sep 2024 11:28:35 +0800 Subject: [PATCH] feat: add Dockerfile --- Dockerfile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5fee2e4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM golang:1.23-alpine AS builder +WORKDIR /workspace + +COPY . . +RUN go get +RUN go build -o /workspace/sniproxy + + +FROM golang:1.23-alpine AS release + +WORKDIR /sniproxy + +RUN mkdir -p /sniproxy/conf + +# Copy from builder +COPY --from=builder /workspace/sniproxy ./sniproxy + +RUN chmod +x sniproxy +COPY config.yaml ./conf + +EXPOSE 443 + +CMD ["./sniproxy","-c","./conf/config.yaml"] \ No newline at end of file