Repository navigation
Expand file tree
/
Copy pathdocker-compose.postgres.yml
More file actions
76 lines (71 loc) · 1.89 KB
/
Copy pathdocker-compose.postgres.yml
File metadata and controls
76 lines (71 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#
# Runs the portal against Postgres instead of MySQL. Layer it over the default
# compose file:
#
# docker compose -f docker-compose.yml -f docker-compose.postgres.yml up
#
# scripts/bootstrap pgsql sets that up for every docker compose command. The
# data lives in a separate volume, so the MySQL data is untouched.
#
volumes:
portal-mysqldata: !reset null
portal-pgdata:
services:
db:
image: postgres:18.6
environment: !override
POSTGRES_DB: members
POSTGRES_USER: dba
POSTGRES_PASSWORD_FILE: /run/secrets/db_dba_password
secrets: !override
- db_dba_password
volumes: !override
- portal-pgdata:/var/lib/postgresql
ports: !override
- "127.0.0.1::5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dba -d members"]
interval: 5s
timeout: 5s
retries: 10
web:
environment:
CONFIG_DB_DRIVER: pgsql
# phpMyAdmin only speaks MySQL
phpmyadmin:
profiles: ["mysql-only"]
pgadmin:
image: dpage/pgadmin4:9.18.0
restart: always
ports:
- "127.0.0.1::80"
environment:
# Desktop mode: no pgAdmin login. The default email is still required.
PGADMIN_CONFIG_SERVER_MODE: "False"
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: "False"
PGADMIN_DEFAULT_EMAIL: admin@example.com
PGADMIN_DEFAULT_PASSWORD_FILE: /run/secrets/db_dba_password
PGADMIN_SERVER_JSON_FILE: /pgadmin4/portal-servers.json
secrets:
- db_dba_password
configs:
- source: pgadmin_servers
target: /pgadmin4/portal-servers.json
depends_on:
- db
configs:
pgadmin_servers:
content: |
{
"Servers": {
"1": {
"Name": "portal",
"Group": "Servers",
"Host": "db",
"Port": 5432,
"MaintenanceDB": "members",
"Username": "dba",
"SSLMode": "prefer"
}
}
}