pgadmin-org / pgadmin-org/pgadmin4
Docker compose deployment: struggling with broken quoting=
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 891
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 8
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the container deployment documentation and the older issue 8529, then inspect how the compose environment values produce /pgadmin4/config_distro.py, especially MAIL_SERVER. Provide a working compose example with correct quoting and verify that the container starts without the shown NameError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker-compose, postgresql, python
- Domain
- databases, devops, documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100