-
Couldn't load subscription status.
- Fork 3.3k
Description
Is your feature request related to a problem? Please describe.
Currently, there are multiple environment variables for each type of database connection. So if several environment variables are passed, for example from Postgres and MySQL/MariaDB, which one will actually be used as the connection?
Describe the solution you'd like
This should be easier when specifying the database engine, configuring fewer environment variables, and knowing where they will be set based on the DB_ENGINE environment variable.
Replace the environment variables and unify them as follows:
DB_MYSQL_HOSTandDB_POSTGRES_HOST, withDB_HOST.DB_MYSQL_PORTandDB_POSTGRES_PORT, withDB_HOST.DB_MYSQL_USERandDB_POSTGRES_USERwithDB_USER.DB_MYSQL_PASSWORDandDB_POSTGRES_PASSWORDwithDB_PASSWORD.DB_MYSQL_NAMEandDB_POSTGRES_NAMEwithDB_NAME.
Describe alternatives you've considered
MySQL/MariaDB stack:
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
# These ports are in format <host-port>:<container-port>
- '80:80' # Public HTTP Port
- '443:443' # Public HTTPS Port
- '81:81' # Admin Web Port
# Add any other Stream port you want to expose
# - '21:21' # FTP
environment:
# MySQL/MariaDB connection parameters:
DB_ENGINE: 'mysql'
DB_HOST: "db"
DB_PORT: 3306
DB_NAME: "npm"
DB_USER: "npm"
DB_PASSWORD: "npm"
# Uncomment this if IPv6 is not enabled on your host
# DISABLE_IPV6: 'true'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
depends_on:
- db
db:
image: 'jc21/mariadb-aria:latest'
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: 'npm'
MYSQL_DATABASE: 'npm'
MYSQL_USER: 'npm'
MYSQL_PASSWORD: 'npm'
MARIADB_AUTO_UPGRADE: '1'
volumes:
- ./mysql:/var/lib/mysqlPostgres stack:
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
# These ports are in format <host-port>:<container-port>
- '80:80' # Public HTTP Port
- '443:443' # Public HTTPS Port
- '81:81' # Admin Web Port
# Add any other Stream port you want to expose
# - '21:21' # FTP
environment:
# PostgreSQL parameters:
DB_ENGINE: 'postgres'
DB_HOST: 'db'
DB_PORT: '5432'
DB_NAME: 'npm'
DB_USER: 'npm'
DB_PASSWORD: 'npmpass'
# Uncomment this if IPv6 is not enabled on your host
# DISABLE_IPV6: 'true'
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
depends_on:
- db
db:
image: postgres:latest
environment:
POSTGRES_USER: 'npm'
POSTGRES_PASSWORD: 'npmpass'
POSTGRES_DB: 'npm'
volumes:
- ./postgres:/var/lib/postgresql/dataAdditional context
The same could work for other SQL databases such as Firebird, Microsoft SQL Server, Oracle, or Amazon Relational Database Service.