diff options
author | Anjan Nath <kaludios@gmail.com> | 2022-05-29 02:01:24 +0530 |
---|---|---|
committer | atanarjuat <atanarjuat@example.com> | 2022-07-28 02:03:09 -0400 |
commit | 626c26b51724468180a8ac1b8967a3e2b700e1ef (patch) | |
tree | e327c14daba05a9a9c92ad3991fa8c6441d5f45e /images/obfsvpn/Dockerfile | |
parent | e3b4f3da53e01c769a8433f5b0f064a1d5fa230a (diff) |
add Dockerfile and scripts for containerized obfsvpn
This is based on github.com/dockovpn/docker-openvpn repository, it adds the
obfsvpn-server binary and config file to the original image
a directory can be bind mounted to /opt/Dockovpn_data to persist data
client.ovpn config file is created in /opt/Dockovpn/client/<client-id>/client.ovpn
it recognises the following environment variables:
OBFS4_HOST = 0.0.0.0 (default) # This is the OBFS4 server endpoint
OBFS4_PORT = 4430
HOST_ADDR = localhost # openvpn gateway ip
PORT = 5540 # openvpn GW port
PROTO = tcp # openvpn proto
Diffstat (limited to 'images/obfsvpn/Dockerfile')
-rw-r--r-- | images/obfsvpn/Dockerfile | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/images/obfsvpn/Dockerfile b/images/obfsvpn/Dockerfile new file mode 100644 index 0000000..9a779a3 --- /dev/null +++ b/images/obfsvpn/Dockerfile @@ -0,0 +1,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 [ "" ] |