[GH-ISSUE #1720] Invalid interpolation format when using docker-compose #1281

Closed
opened 2026-02-26 06:36:33 +03:00 by kerem · 11 comments
Owner

Originally created by @jayjupdhig on GitHub (Jan 3, 2022).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1720

hi there

os: latest version of debian 11

mariadb: latest version 10.6 direct from mariadb apt repo

docker: latest version from docker.io apt repo

then i executed "mysql_secure_installation" and set password to 123456$ for testing purposes.

after that, i changed the file docker-compose.yml as follows:

version: "3"
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:
      DB_MYSQL_HOST: "localhost"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "npm"
      DB_MYSQL_PASSWORD: "npm"
      DB_MYSQL_NAME: "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: '123456$'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'npm'
      MYSQL_PASSWORD: 'npm'
    volumes:
      - ./data/mysql:/var/lib/mysql

Original from https://nginxproxymanager.com/setup/#using-mysql-mariadb-database is that here:

version: "3"
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:
      DB_MYSQL_HOST: "db"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "npm"
      DB_MYSQL_PASSWORD: "npm"
      DB_MYSQL_NAME: "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'
    volumes:
      - ./data/mysql:/var/lib/mysql

...but my mariadb server hostname is neither "db" nor its root password is "npm"... so i changed it.

But, after that, now i get that error when i enter ´docker-compose up -d´:

root@debian11-nginx-proxy-manager:~# docker-compose up -d
ERROR: Invalid interpolation format for "environment" option in service "db": "123456$"

QUESTION: Why??

Originally created by @jayjupdhig on GitHub (Jan 3, 2022). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1720 hi there os: latest version of debian 11 mariadb: latest version 10.6 direct from mariadb apt repo docker: latest version from docker.io apt repo then i executed "mysql_secure_installation" and set password to 123456$ for testing purposes. after that, i changed the file docker-compose.yml as follows: ```yml version: "3" 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: DB_MYSQL_HOST: "localhost" DB_MYSQL_PORT: 3306 DB_MYSQL_USER: "npm" DB_MYSQL_PASSWORD: "npm" DB_MYSQL_NAME: "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: '123456$' MYSQL_DATABASE: 'npm' MYSQL_USER: 'npm' MYSQL_PASSWORD: 'npm' volumes: - ./data/mysql:/var/lib/mysql ``` Original from https://nginxproxymanager.com/setup/#using-mysql-mariadb-database is that here: ```yml version: "3" 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: DB_MYSQL_HOST: "db" DB_MYSQL_PORT: 3306 DB_MYSQL_USER: "npm" DB_MYSQL_PASSWORD: "npm" DB_MYSQL_NAME: "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' volumes: - ./data/mysql:/var/lib/mysql ``` ...but my mariadb server hostname is neither "db" nor its root password is "npm"... so i changed it. But, after that, now i get that error when i enter ´docker-compose up -d´: ``` root@debian11-nginx-proxy-manager:~# docker-compose up -d ERROR: Invalid interpolation format for "environment" option in service "db": "123456$" ``` **QUESTION:** Why??
kerem 2026-02-26 06:36:33 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@jayjupdhig commented on GitHub (Jan 3, 2022):

Im sorry code format currently seems not to work on guithub with `-character...

<!-- gh-comment-id:1004042152 --> @jayjupdhig commented on GitHub (Jan 3, 2022): Im sorry code format currently seems not to work on guithub with `-character...
Author
Owner

@chaptergy commented on GitHub (Jan 3, 2022):

Docker compose wants to do variable substitution when it sees a dollar sign in a value. See the docker-compose docs. If you want a literal dollar sign $ you have to write two dollar signs instead $$.

<!-- gh-comment-id:1004045902 --> @chaptergy commented on GitHub (Jan 3, 2022): Docker compose wants to do variable substitution when it sees a dollar sign in a value. See the [docker-compose docs](https://docs.docker.com/compose/compose-file/compose-file-v2/#variable-substitution). If you want a literal dollar sign `$` you have to write two dollar signs instead `$$`.
Author
Owner

@jayjupdhig commented on GitHub (Jan 3, 2022):

OK, thank you very much.

What parameters do i need to change (as configured in "mysql_secure_installation") ?

Only the mysql/mariadb root password? Do need to create to "npm" database and its users manually or not?

<!-- gh-comment-id:1004062427 --> @jayjupdhig commented on GitHub (Jan 3, 2022): OK, thank you very much. What parameters do i need to change (as configured in "mysql_secure_installation") ? Only the mysql/mariadb root password? Do need to create to "npm" database and its users manually or not?
Author
Owner

@jayjupdhig commented on GitHub (Jan 3, 2022):

And: Is it correct to install MariaDB / MySQL BEFORE installing that docker thing? Or will install docker the database engine?

<!-- gh-comment-id:1004069691 --> @jayjupdhig commented on GitHub (Jan 3, 2022): And: Is it correct to install MariaDB / MySQL BEFORE installing that docker thing? **Or will install docker the database engine?**
Author
Owner

@jayjupdhig commented on GitHub (Jan 3, 2022):

Doesn't work...
https://github.com/jc21/nginx-proxy-manager/issues/1721

<!-- gh-comment-id:1004112943 --> @jayjupdhig commented on GitHub (Jan 3, 2022): Doesn't work... https://github.com/jc21/nginx-proxy-manager/issues/1721
Author
Owner

@jayjupdhig commented on GitHub (Jan 3, 2022):

There is no database, but the connection data is correctly

image

version: "3"
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:
      DB_MYSQL_HOST: "localhost"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "npm"
      DB_MYSQL_PASSWORD: "npm"
      DB_MYSQL_NAME: "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: '123456$$'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'npm'
      MYSQL_PASSWORD: 'npm'
    volumes:
      - ./data/mysql:/var/lib/mysql
<!-- gh-comment-id:1004114257 --> @jayjupdhig commented on GitHub (Jan 3, 2022): There is no database, but the connection data is correctly ![image](https://user-images.githubusercontent.com/42765391/147939784-5db6a00a-fa57-4624-b626-212cc92c63aa.png) ```yml version: "3" 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: DB_MYSQL_HOST: "localhost" DB_MYSQL_PORT: 3306 DB_MYSQL_USER: "npm" DB_MYSQL_PASSWORD: "npm" DB_MYSQL_NAME: "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: '123456$$' MYSQL_DATABASE: 'npm' MYSQL_USER: 'npm' MYSQL_PASSWORD: 'npm' volumes: - ./data/mysql:/var/lib/mysql ```
Author
Owner

@jayjupdhig commented on GitHub (Jan 3, 2022):

Do i need to create database and its users manually or not?!?

<!-- gh-comment-id:1004114632 --> @jayjupdhig commented on GitHub (Jan 3, 2022): Do i need to create database and its users manually or not?!?
Author
Owner

@jayjupdhig commented on GitHub (Jan 3, 2022):

Can't find any hints on https://nginxproxymanager.com/setup/#running-on-raspberry-pi-arm-devices

<!-- gh-comment-id:1004115164 --> @jayjupdhig commented on GitHub (Jan 3, 2022): Can't find any hints on https://nginxproxymanager.com/setup/#running-on-raspberry-pi-arm-devices
Author
Owner

@jayjupdhig commented on GitHub (Jan 3, 2022):

oh no i meant https://nginxproxymanager.com/setup/#using-mysql-mariadb-database

<!-- gh-comment-id:1004115435 --> @jayjupdhig commented on GitHub (Jan 3, 2022): oh no i meant https://nginxproxymanager.com/setup/#using-mysql-mariadb-database
Author
Owner

@chaptergy commented on GitHub (Jan 3, 2022):

What parameters do i need to change?

Everywhere a $ is used in a value. Just replace it with two dollar signs.

Do i need to create database and its users manually or not?!?

No, you don't.

Is it correct to install MariaDB / MySQL BEFORE installing that docker thing?

If you already have a database you can use that, then you would need to change MYSQL_ environment variables to be correct for your own database. Then you also don't need the db section in your docker-compose. If you don't already have a database you can just keep everything as-is. The docker-compose file in the docs will start a container with a database.

Doesn't work... #1721

Then your database is either not running or not accessible from the npm docker container. Or you have provided invalid credentials or hostnames.

<!-- gh-comment-id:1004169821 --> @chaptergy commented on GitHub (Jan 3, 2022): > What parameters do i need to change? Everywhere a `$` is used in a value. Just replace it with two dollar signs. > Do i need to create database and its users manually or not?!? No, you don't. > Is it correct to install MariaDB / MySQL BEFORE installing that docker thing? If you already have a database you can use that, then you would need to change `MYSQL_` environment variables to be correct for your own database. Then you also don't need the `db` section in your docker-compose. If you don't already have a database you can just keep everything as-is. The docker-compose file in the docs will start a container with a database. > Doesn't work... #1721 Then your database is either not running or not accessible from the npm docker container. Or you have provided invalid credentials or hostnames.
Author
Owner

@jayjupdhig commented on GitHub (Jan 11, 2022):

Another question HERE: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1736

<!-- gh-comment-id:1010031268 --> @jayjupdhig commented on GitHub (Jan 11, 2022): Another question HERE: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1736
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#1281
No description provided.