Initial checkin

This commit is contained in:
Radar231 2021-08-01 16:32:22 -04:00
commit 8014e6996f
3 changed files with 120 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.env

70
README.md Normal file
View File

@ -0,0 +1,70 @@
# nginx-proxy-manager docker deployment
## Introduction
This is a docker-compose configuration to deploy an nginx-proxy-manager
instance. It provides web site proxying via nginx, as well as SSL
support via letsencrypt.
## Custom Network
To simplify inter-container communications when using a docker-compose
file for each web site, create a custom network to be shared between
nginx-proxy-manager and each web app.
<pre>
$ docker network create npm-backend
</pre>
To use this network, a networks section needs to be added to each
docker-compose.yml file. In addition, the nginx-proxy-manager is set
to use both it's default network, as well as the npm-backend network.
For all of the web apps, the npm-backend will be set as the default network.
<pre>
-----[ nginx-proxy-manager docker.compose.yml ]-----
---
version: '3'
networks:
npm-backend:
external:
name: npm-backend
services:
nginx-proxy-manager:
(...)
networks:
- default
- npm-backend
(...)
-----[ each web app docker.compose.yml ]-----
---
version: '3.2'
services:
web-app:
(...)
networks:
default:
external: true
name: npm-backend
</pre>
## Links
* https://nginxproxymanager.com
* https://github.com/jc21/nginx-proxy-manager
* https://letsencrypt.org
## Directories
<pre>
nginx-proxy-manager
├── data
│   └── mysql
└── letsencrypt
</pre>

49
docker-compose.yml Normal file
View File

@ -0,0 +1,49 @@
---
version: '3'
networks:
npm-backend:
external:
name: npm-backend
services:
nginx-proxy-manager:
container_name: nginx-proxy-manager
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80'
- '81:81'
- '443:443'
env_file:
- npm.env
environment:
DB_MYSQL_HOST: "db"
DB_MYSQL_PORT: 3306
# values in .env file
# DB_MYSQL_USER: "xxxxxxx"
# DB_MYSQL_PASSWORD: "xxxxxxx"
DB_MYSQL_NAME: "npm"
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
networks:
- default
- npm-backend
db:
container_name: npm-db
image: 'jc21/mariadb-aria:latest'
restart: unless-stopped
env_file:
- npm.env
environment:
MYSQL_DATABASE: 'npm'
# values in .env file
# MYSQL_ROOT_PASSWORD: 'xxxxxxx'
# MYSQL_USER: 'xxxxxxx'
# MYSQL_PASSWORD: 'xxxxxxx'
volumes:
- ./data/mysql:/var/lib/mysql
# EOF