Skip to content

Docker compose deployment: struggling with broken quoting= #10364

Description

@thommierother

I am looking for a working example to deploy pgadmin4 with docker compose. In my case I see the following errors on startup:

pgadmin4-1  | email config is {'CHECK_EMAIL_DELIVERABILITY': False, 'ALLOW_SPECIAL_EMAIL_DOMAINS': [], 'GLOBALLY_DELIVERABLE': True}  
pgadmin4-1  | Traceback (most recent call last):  
pgadmin4-1  |   File "/pgadmin4/run_pgadmin.py", line 4, in <module>  
pgadmin4-1  |     from pgAdmin4 import app  
pgadmin4-1  |   File "/pgadmin4/pgAdmin4.py", line 38, in <module>  
pgadmin4-1  |     import config  
pgadmin4-1  |   File "/pgadmin4/config.py", line 1126, in <module>  
pgadmin4-1  |     from pgadmin.evaluate_config import evaluate_and_patch_config  
pgadmin4-1  |   File "/pgadmin4/pgadmin/evaluate_config.py", line 64, in <module>  
pgadmin4-1  |     config_distro = import_module_from_path('config_distro',  
pgadmin4-1  |                                             config_distro_path)  
pgadmin4-1  |   File "/pgadmin4/pgadmin/evaluate_config.py", line 38, in import_module_from_path  
pgadmin4-1  |     spec.loader.exec_module(module)  
pgadmin4-1  |     ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^  
pgadmin4-1  |   File "/pgadmin4/config_distro.py", line 13, in <module>  
pgadmin4-1  |     MAIL_SERVER = mail.netzwissen.de  
pgadmin4-1  |                   ^^^^  
pgadmin4-1  | NameError: name 'mail' is not defined

The docker compose file

root@docker6:/etc/docker/pgadmin# less docker-compose.yaml    
# version: "3.8"  
services:  
 pgadmin4:  
   hostname: pgadmin4  
   image: dpage/pgadmin4:latest  
   restart: always  
   environment:  
     PGADMIN_DEFAULT_EMAIL: '[mail@example.com]'  
     PGADMIN_DEFAULT_PASSWORD: '[redacted]'  
     PGADMIN_LISTEN_PORT: 5050  
     PGADMIN_CONFIG_ENHANCED_COOKIE_PROTECTION: true  
     PGADMIN_CONFIG_CONSOLE_LOG_LEVEL: 10  
     PGADMIN_SERVER_JSON_FILE: 'servers.json'  
     PGADMIN_PGPASS_FILE: 'pgpass'  
     PGADMIN_DISABLE_POSTFIX: true  
     PGADMIN_CONFIG_MAIL_SERVER: '[mail.example.com]'  
     PGADMIN_CONFIG_MAIL_PORT: 587  
     PGADMIN_CONFIG_MAIL_USE_SSL: false  
     PGADMIN_CONFIG_MAIL_USE_TLS: true  
     PGADMIN_CONFIG_MAIL_USERNAME: '[mail@example.com]'  
     PGADMIN_CONFIG_MAIL_PASSWORD: '[redacted]'  
     PGADMIN_CONFIG_MAIL_DEBUG: false  
     PGADMIN_CONFIG_MAIL_SECURITY_EMAIL_SENDER: '[mail@example.com]'  
   volumes:  
     - ./servers.json:/pgadmin4/servers.json # servers available  
     - ./pgpass:/pgpass # passwords for the connections in this file  
   networks:  
     - pgadmin  
   ports:  
     - 5050:5050
     - 

There is an older issue at which indicates some problems with quoting env variables. I could not find any information about correct quoting on https://www.pgadmin.org/docs/pgadmin4/latest/container_deployment.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions