-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Description
Is your feature request related to a problem? Please describe.
update for documentation's sample docker-compose.yaml
Describe the solution you'd like
example docker-compose.yaml script from documentation
uses mounting volume(folder) for database and npm folders.
but it's error prone because your sample script is using relative path ./data
that **./data** could cause error depending on where the user run docker-compose up -f /path/to/docker-compose.yml
if ./data already existed error bellow could happen (that most of the people asks at issue tab)
error example 1
ER_ACCESS_DENIED_ERROR: Access denied for user 'npm'@'172.21.0.3' (using password: YES)
error example 2
error that shows bad gateway first login such as this issue
so solution
no one mentioned this issue because he solved his own problem and closed the issue
I saw other solutions at stackoverflow or reddit but
this was the most simple and safe from other side affect (which could be caused by editing config files)
it just adds docker volume (in my case external - so it could be safe when redeployed)
docker-compose.yaml I used and worked
version: "3"
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
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: "npm"
DB_MYSQL_NAME: "npm"
DISABLE_IPV6: 'true'
volumes:
- npm_system:/data #### change here ####
- ./letsencrypt:/etc/letsencrypt
depends_on:
- db
db:
image: mysql
command: --default-authentication-plugin=mysql_native_password
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: 'npm'
MYSQL_DATABASE: 'npm'
MYSQL_USER: 'npm'
MYSQL_PASSWORD: 'npm'
volumes:
- npm_system_db:/var/lib/mysql #### change here ####
#### change here ####
volumes:
npm_system_db:
external: true
npm_system:
external: truejust adding external docker volume