docker files

This commit is contained in:
mantaohuang 2020-05-30 00:32:59 -04:00
parent c6661985d5
commit a3ece11d2b
2 changed files with 24 additions and 7 deletions

View File

@ -1,8 +1,23 @@
FROM golang:alpine
FROM golang:alpine AS go-builder
RUN apk --no-cache add git
WORKDIR /
RUN git clone https://git.hmthsn.com/mantao/ovpn-lb-socks5.git
WORKDIR /ovpn-lb-socks5/go-socks-lb
RUN go build
FROM alpine:latest AS python-builder
RUN apk --no-cache add git python3 python3-dev linux-headers musl-dev gcc
WORKDIR /
RUN git clone https://git.hmthsn.com/mantao/ovpn-lb-socks5.git mop
WORKDIR /mop
RUN python3 -m venv env
ENV PATH="/mop/env/bin:$PATH"
RUN pip install -r docker_requirement.txt
FROM alpine:latest
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && \
apk add --update openvpn iptables bash git python3 shadow neovim linux-headers musl-dev 3proxy ip6tables gcc && \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*
CMD tail -f /dev/null
apk --no-cache add openvpn iptables ip6tables bash python3 shadow neovim 3proxy
COPY --from=python-builder /mop /
COPY --from=go-builder /ovpn-lb-socks5/go-socks-lb/go-socks-lb /mop/go-socks-lb
CMD /mop/docker-entrypoint.sh

View File

@ -1,4 +1,4 @@
version: '3.4'
version: "3.4"
services:
ovpn_lb_test:
@ -13,4 +13,6 @@ services:
- ./config:/config
cap_add:
- net_admin
environment:
CONFIG_FOLDER: /config
AUTH_FILE: /config/fast.txt