-php:
- build: ../../php/
+app:
+ image: php:7.0-fpm-alpine
volumes:
#- ./../../../..:/opt/nb
- ./../../../../..:/opt
- ./:/var/www/html
#- ./../../../../lib/php/db:/var/www/html
-# NB 20.11.16 command:
-# NB 20.11.16 - "/bin/echo HELLO > /HELLO"
+ command: "echo . /opt/nb/etc/profile > /etc/profile.d/nb.sh"
+php:
+ build: ../../php/
+ volumes_from:
+ - app
expose:
- 9000
--- /dev/null
+FROM alpine:latest
+RUN apk update && apk add openvpn
+ADD ./docker-start.sh /etc/openvpn/docker-start.sh
+RUN chmod 755 /etc/openvpn/docker-start.sh
+CMD "/etc/openvpn/docker-start.sh"
--- /dev/null
+#!/usr/bin/env sh
+
+[ -e /dev/net ] || mkdir -p /dev/net
+[ -e /dev/net/tun ] || mknod /dev/net/tun c 10 200
+
+if [ -e /etc/openvpn/server.conf ]; then
+ CONF=/etc/openvpn/server.conf
+ IP=$(grep '^server .*$' /etc/openvpn/server.conf | awk '{print $2}')
+ iptables -t nat -A POSTROUTING -s ${IP}/24 -o eth0 -j MASQUERADE
+
+elif [ -e /etc/openvpn/client.conf ]; then
+ CONF=/etc/openvpn/client.conf
+
+else
+
+ echo "No server or client config file"
+ exit
+
+fi
+
+/usr/sbin/openvpn --cd /etc/openvpn --config $CONF --script-security 2