[GH-ISSUE #272] Include config file in the image for bundling with server installers #238

Closed
opened 2026-02-26 06:31:42 +03:00 by kerem · 2 comments
Owner

Originally created by @rogerleecormier on GitHub (Jan 7, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/272

Is your feature request related to a problem? Please describe.
I am looking to leverage a software installer application that dynamically generates docker compose containers. Our process does not allow for config file generation or external files outside the image. If the the this feature is added, there is a strong possibility that NPM will be added to our software repository.

Describe the solution you'd like
I would like to see the config.json included in the image itself, and copies itself to the config folder, which is mounted via a bind volume. I would also like to see the json file include environment variables that are referenced via docker compose for easy modification of credentials.

Describe alternatives you've considered
We discussed dynamically generating the json file, but this is a process that is outside the intent of the installer program. We would prefer an integrated config file, so the image comes whole.

Additional context
Here is an example of what possibly can be leveraged:

DOCKER-COMPOSE.YML

services:
# NGINX Proxy Manager with LetsEncrypt https://github.com/jc21/nginx-proxy-manager
  proxymanager:
    image: jc21/nginx-proxy-manager:latest
    container_name: proxymanager
    labels:
      - "com.dockstarter.appinfo.description: NGINX Proxy Manager with LetsEncrypt included"
      - "com.dockstarter.appinfo.nicename: NGINX Proxy Manager"
    logging:
      driver: json-file
      options:
        max-file: ${DOCKERLOGGING_MAXFILE}
        max-size: ${DOCKERLOGGING_MAXSIZE}
    ports:
      - "80:80"
      - "81:81"
      - "443:443"
    environment:
      - engine=mysql
      - host=mariadb
      - name=proxymgr
      - user=usernamehere
      - password=passwordhere
      - port=port
      - FORCE_COLOR=1
    volumes:
      - ${DOCKERCONFDIR}/proxymanager/config:/app/config/
      - ${DOCKERCONFDIR}/proxymanager/data:/data
      - ${DOCKERCONFDIR}/proxymanager/letsencrypt:/etc/letsencrypt
      - ${DOCKERSHAREDDIR}:/shared
    depends_on:
      - mariadb
    restart: unless-stopped

NOTE: ${DOCKERCONFDIR} is the compose variable for the config directory for our application. This is just an example of how it could work.

CONFIG.JSON

{
  "database": {
    "engine": "${engine}",
    "host": "${host}",
    "name": "${name}",
    "user": "${user}",
    "password": "${password}",
    "port": "${port}"
  }
}
Originally created by @rogerleecormier on GitHub (Jan 7, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/272 **Is your feature request related to a problem? Please describe.** I am looking to leverage a software installer application that dynamically generates docker compose containers. Our process does not allow for config file generation or external files outside the image. If the the this feature is added, there is a strong possibility that NPM will be added to our software repository. **Describe the solution you'd like** I would like to see the config.json included in the image itself, and copies itself to the config folder, which is mounted via a bind volume. I would also like to see the json file include environment variables that are referenced via docker compose for easy modification of credentials. **Describe alternatives you've considered** We discussed dynamically generating the json file, but this is a process that is outside the intent of the installer program. We would prefer an integrated config file, so the image comes whole. **Additional context** Here is an example of what possibly can be leveraged: _**DOCKER-COMPOSE.YML**_ ````yaml services: # NGINX Proxy Manager with LetsEncrypt https://github.com/jc21/nginx-proxy-manager proxymanager: image: jc21/nginx-proxy-manager:latest container_name: proxymanager labels: - "com.dockstarter.appinfo.description: NGINX Proxy Manager with LetsEncrypt included" - "com.dockstarter.appinfo.nicename: NGINX Proxy Manager" logging: driver: json-file options: max-file: ${DOCKERLOGGING_MAXFILE} max-size: ${DOCKERLOGGING_MAXSIZE} ports: - "80:80" - "81:81" - "443:443" environment: - engine=mysql - host=mariadb - name=proxymgr - user=usernamehere - password=passwordhere - port=port - FORCE_COLOR=1 volumes: - ${DOCKERCONFDIR}/proxymanager/config:/app/config/ - ${DOCKERCONFDIR}/proxymanager/data:/data - ${DOCKERCONFDIR}/proxymanager/letsencrypt:/etc/letsencrypt - ${DOCKERSHAREDDIR}:/shared depends_on: - mariadb restart: unless-stopped ```` NOTE: ${DOCKERCONFDIR} is the compose variable for the config directory for our application. This is just an example of how it could work. _**CONFIG.JSON**_ ````json { "database": { "engine": "${engine}", "host": "${host}", "name": "${name}", "user": "${user}", "password": "${password}", "port": "${port}" } } ````
kerem 2026-02-26 06:31:42 +03:00
Author
Owner

@Subv commented on GitHub (May 30, 2020):

I think this is already possible by using the NODE_CONFIG environment variable ( https://github.com/lorenwest/node-config/wiki/Environment-Variables ). Though I haven't tested it.

<!-- gh-comment-id:636355886 --> @Subv commented on GitHub (May 30, 2020): I think this is already possible by using the `NODE_CONFIG` environment variable ( https://github.com/lorenwest/node-config/wiki/Environment-Variables ). Though I haven't tested it.
Author
Owner

@chaptergy commented on GitHub (May 11, 2021):

Possible via https://github.com/jc21/nginx-proxy-manager/pull/704

<!-- gh-comment-id:839007843 --> @chaptergy commented on GitHub (May 11, 2021): Possible via https://github.com/jc21/nginx-proxy-manager/pull/704
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#238
No description provided.