forked from dockovpn/dockovpn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (34 loc) · 1.18 KB
/
Dockerfile
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
41
42
43
44
FROM alpine:3.14.1
LABEL maintainer="Alexander Litvinenko <[email protected]>"
# System settings. User normally shouldn't change these parameters
ENV APP_NAME Dockovpn
ENV APP_INSTALL_PATH /opt/${APP_NAME}
ENV APP_PERSIST_DIR /opt/${APP_NAME}_data
# Configuration settings with default values
ENV NET_ADAPTER eth0
ENV HOST_ADDR ""
ENV HOST_TUN_PORT 1194
ENV HOST_CONF_PORT 80
ENV HOST_TUN_PROTOCOL udp
ENV CRL_DAYS 3650
WORKDIR ${APP_INSTALL_PATH}
COPY scripts .
COPY config ./config
COPY VERSION ./config
RUN apk add --no-cache openvpn easy-rsa bash netcat-openbsd zip curl dumb-init && \
ln -s /usr/share/easy-rsa/easyrsa /usr/bin/easyrsa && \
mkdir -p ${APP_PERSIST_DIR} && \
cd ${APP_PERSIST_DIR} && \
easyrsa init-pki && \
easyrsa gen-dh && \
# DH parameters of size 2048 created at /usr/share/easy-rsa/pki/dh.pem
# Copy DH file
cp pki/dh.pem /etc/openvpn && \
# Copy FROM ./scripts/server/conf TO /etc/openvpn/server.conf in DockerFile
cd ${APP_INSTALL_PATH} && \
cp config/server.conf /etc/openvpn/server.conf
EXPOSE 1194/${HOST_TUN_PROTOCOL}
EXPOSE 8080/tcp
VOLUME [ "/opt/Dockovpn_data" ]
ENTRYPOINT [ "dumb-init", "./start.sh" ]
CMD [ "" ]