summaryrefslogtreecommitdiff
path: root/images/obfsvpn/Dockerfile
blob: 9a779a3c2fc7061f612c2e5f1e0e3db1cb2ddb22 (plain)
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
FROM golang:1.17 AS build

ENV SOURCE_PATH ${GOPATH}/src/0xacab.org/leap/obfsvpn
COPY . ${SOURCE_PATH}/
WORKDIR ${SOURCE_PATH}
RUN cd server && make build && cp server /obfsvpn-server


FROM alpine:3.14.1

ENV APP_NAME Dockovpn
ENV APP_INSTALL_PATH /opt/${APP_NAME}
ENV APP_PERSIST_DIR /opt/${APP_NAME}_data
ENV OBFS4_DATA_DIR /opt/obfsvpn-server-data
ENV PROTO tcp
ENV PORT 5540

ENV OBFS4_HOST 0.0.0.0
ENV OBFS4_PORT 4430

WORKDIR ${APP_INSTALL_PATH}

RUN apk add --no-cache openvpn easy-rsa bash netcat-openbsd zip dumb-init

COPY --from=build /obfsvpn-server .

COPY images/obfsvpn/scripts .
COPY images/obfsvpn/config ./config
COPY server/test_data ./obfsvpn-server-data

RUN mkdir -p ${APP_PERSIST_DIR} && \
    cd ${APP_INSTALL_PATH} && \
    cp config/server.conf /etc/openvpn/server.conf

EXPOSE 5540/tcp

VOLUME [ "/opt/Dockovpn_data" ]

ENTRYPOINT [ "dumb-init", "./start.sh" ]
CMD [ "" ]