OpenVPN-Admin
OpenVPN-Admin copied to clipboard
Provide a Dockerfile
It would be great to support Docker as deployment strategy. This way people could test this tool pretty fast and check if it fits their needs. Has someony already build a dockerfile for this? I'm not that experienced in it but would be willing to contribute as far as i can.
I've made a first attempt to accomplish this by writing my first dockerfile. I installed all the prerequisites, created some required directories and executed the npm install procedure. I skipped the mysql installation as it looks to me more lightweight to build therefore a separate mysql container and connect them by "docker --link" command.
Actually I stuck at the install.sh script which is only written for a local mysql installation and accepts no parameters for host, port and root_password.
FROM eboraas/apache-php
MAINTAINER Sebastian Mittnacht [email protected]
# Install prerequisites
RUN apt-get -y update && apt-get install -y openvpn mysql-client nodejs unzip \
git wget sed npm curl
# Cloneing and switching directory
RUN mkdir -p ~/.ssh && \
ssh-keyscan github.com >> ~/.ssh/known_hosts &&\
mkdir -p /usr/src/OpenVPN-Admin && \
git clone https://github.com/seppi91/OpenVPN-Admin.git /usr/src/OpenVPN-Admin && \
mkdir -p /opt/OpenVPN-Admin
WORKDIR /usr/src/OpenVPN-Admin
RUN git checkout docker
# Install nodejs server
RUN npm install -g bower && \
ln -s /usr/bin/nodejs /usr/bin/node
VOLUME ["/etc/openvpn"]
EXPOSE 1194/udp 443/tcp
ARG MYSQL_PASS
ARG WEB_USER=www-data
ARG WEB_GROUP=www-data
ENV WEB_BASE=/opt/OpenVPN-Admin
CMD ["/bin/sh", "-c", "./install.sh $WEB_USER $WEB_GROUP $WEB_BASE $MYSQL_PASS"]
I recommend you to install mysql in the container, try to make things work and then put it outside and link them with docker compose for example :)
Maybe https://github.com/kylemanna/docker-openvpn could help you?
Actually, don't do that (include mysql inside). You're really going to need to do everything the install script does in the Dockerfile. The idea is that when they go to launch this, it starts and is ready to go (serving etc..)