Skip to content

Instantly share code, notes, and snippets.

@alfa-jpn
Created June 15, 2019 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alfa-jpn/51ed22a2333b853d092bc6a42e30ba04 to your computer and use it in GitHub Desktop.
Save alfa-jpn/51ed22a2333b853d092bc6a42e30ba04 to your computer and use it in GitHub Desktop.
# Install Docker
apt-get update
apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-common -y
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
apt-key fingerprint 0EBFCD88
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
apt-get update
apt-get install docker-ce -y
# Install DockerCompose
curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
/etc/init.d/docker start
# Intall VPN
mkdir -p /vpn
cat <<EOF > /vpn/docker-compose.yml
version: '3'
services:
vpn:
image: jippi/pritunl:1.29.2051.18
privileged: true
restart: always
environment:
PRITUNL_MONGODB_URI: "mongodb://mongo:27017/pritunl"
volumes:
- /vpn/data/pritunl:/var/lib/pritunl
ports:
- 114:443
- 514:514/udp
depends_on:
- mongo
mongo:
image: mongo:3.2-jessie
restart: always
volumes:
- /vpn/data/mongo:/data/db
EOF
cat <<EOF > /vpn/pritunl
#!/bin/sh
docker exec -it \$(docker ps | grep pritunl | grep -o '^\S\+') pritunl \$@
EOF
chmod a+x /vpn/pritunl
# Launch VPN
cd /vpn && docker-compose up -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment