Skip to content

Include config file in the image for bundling with server installers #272

@rogerleecormier

Description

@rogerleecormier

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}"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions