From 06600e0ffd74dd5f969f35f6cbb5049b7c97fbc9 Mon Sep 17 00:00:00 2001 From: mwwalters Date: Sat, 25 Jul 2026 12:22:09 -0400 Subject: [PATCH] updated docker-compose example --- docker/container-snippet-docker-compose.yml | 1 + docker/example-docker-compose.yml | 54 +++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 docker/example-docker-compose.yml diff --git a/docker/container-snippet-docker-compose.yml b/docker/container-snippet-docker-compose.yml index f1daf2b..fdc7149 100644 --- a/docker/container-snippet-docker-compose.yml +++ b/docker/container-snippet-docker-compose.yml @@ -1,6 +1,7 @@ # --- add this snippet to your existing docker-compose.yml file --- # --- this will define a small container that will serve the maintenance page you define in /maintenance/index.html--- # --- this assumes you have a docker network by the name nginxproxymanager --- +# --- this container must have access to the same docker network as your nginx proxy manager container to function --- # --- Maintenance page container --- maintenance: diff --git a/docker/example-docker-compose.yml b/docker/example-docker-compose.yml new file mode 100644 index 0000000..d3acb1a --- /dev/null +++ b/docker/example-docker-compose.yml @@ -0,0 +1,54 @@ +services: + app: + build: . + image: jc21/nginx-proxy-manager:custom + restart: unless-stopped + ports: + - '80:80' # Public HTTP Port + - '443:443' # Public HTTPS Port + - '81:81' # Admin Web Port + environment: + DB_MYSQL_HOST: 'db' + DB_MYSQL_PORT: '3306' + DB_MYSQL_USER: 'npm' + DB_MYSQL_PASSWORD: 'your_secure_password' # Replace with your secure password + DB_MYSQL_NAME: 'npm' + TZ: 'your_timezone_here' # Set the timezone + # Uncomment this if IPv6 is not enabled on your host + # DISABLE_IPV6: 'true' + volumes: + - ./data:/data + - ./letsencrypt:/etc/letsencrypt + - /root/nginx-proxy-manager/logs:/data/logs # Bind host logs directory + depends_on: + - db + networks: + - nginxproxymanager + + db: + image: 'jc21/mariadb-aria:latest' + restart: unless-stopped + environment: + MYSQL_ROOT_PASSWORD: 'your_secure_root_password' # Replace with your secure root password + MYSQL_DATABASE: 'npm' + MYSQL_USER: 'npm' + MYSQL_PASSWORD: 'your_secure_password' # Replace with your secure password + MARIADB_AUTO_UPGRADE: '1' + volumes: + - ./mysql:/var/lib/mysql + networks: + - nginxproxymanager + + # --- Maintenance page container --- + maintenance: + image: nginx:alpine + restart: unless-stopped + volumes: + - ./maintenance:/usr/share/nginx/html:ro + networks: + - nginxproxymanager + # ---------------------------------- + +networks: + nginxproxymanager: + external: true