Last active
May 5, 2021 04:14
-
-
Save TomMarius/7af8d51626966982bb316f84f7a817d5 to your computer and use it in GitHub Desktop.
User Data to bring up Postgres, NGINX, Let's Encrypt etc; expects Docker to be installed - for use with DigitalOcean Docker image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! | |
| docker run -d --name db \ | |
| --restart always \ | |
| --volume /var/lib/postgresql/data \ | |
| -e "POSTGRES_PASSWORD=yourpassword" \ | |
| postgres | |
| docker run -d --name proxy \ | |
| --restart always \ | |
| --volume /var/run/docker.sock:/tmp/docker.sock:ro \ | |
| --volume certs:/etc/nginx/certs \ | |
| --volume vhost:/etc/nginx/vhost.d \ | |
| --volume html:/usr/share/nginx/html \ | |
| -p 80 \ | |
| -p 443 \ | |
| nginxproxy/nginx-proxy | |
| docker run -d --name acme \ | |
| --restart always \ | |
| --volumes-from proxy \ | |
| --volume /var/run/docker.sock:/var/run/docker.sock:ro \ | |
| --volume acme:/etc/acme.sh \ | |
| -e "DEFAULT_EMAIL=admin@yourdomain.tld" \ | |
| nginxproxy/acme-companion | |
| docker run -d --name app \ | |
| --restart always \ | |
| -p 3000 \ | |
| -e "VIRTUAL_PORT=3000" \ | |
| -e "VIRTUAL_HOST=yourdomain.tld" \ | |
| -e "LETSENCRYPT_HOST=yourdomain.tld" \ | |
| yourdockerimg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment