docker support

This commit is contained in:
PaperDragon-SH 2023-08-30 14:59:54 +08:00 committed by B. Blechschmidt
parent 05cb35fabb
commit c0c7fda891
3 changed files with 81 additions and 0 deletions

28
Dockerfile Normal file
View file

@ -0,0 +1,28 @@
####################################################################################################
## Builder
####################################################################################################
FROM rust:latest AS builder
WORKDIR /worker
COPY ./ .
RUN cargo build --release --target x86_64-unknown-linux-gnu
####################################################################################################
## Final image
####################################################################################################
FROM ubuntu:latest
WORKDIR /app
ENV TUN=tun0
ENV PROXY=
ENV DNS=virtual
ENV MODE=auto
ENV BYPASS_IP=
RUN apt update && apt install -y iproute2 curl && apt clean all
COPY --from=builder /worker/target/x86_64-unknown-linux-gnu/release/tun2proxy /usr/bin/tun2proxy
COPY --from=builder /worker/docker/entrypoint.sh /app
ENTRYPOINT ["/app/entrypoint.sh"]