-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
65 lines (62 loc) · 1.82 KB
/
Copy pathdocker-compose.yml
File metadata and controls
65 lines (62 loc) · 1.82 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
services:
pgadmin:
image: dpage/pgadmin4:latest
container_name: pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: admin@database.com
PGADMIN_DEFAULT_PASSWORD: custom_secure_password_123
PGADMIN_CONFIG_SERVER_MODE: 'False'
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: 'False'
user: root
entrypoint: >
/bin/sh -c "
mkdir -p /var/lib/pgadmin &&
echo '{\"Servers\":{\"1\":{\"Name\":\"Database Server\",\"Group\":\"Servers\",\"Host\":\"database\",\"Port\":5432,\"MaintenanceDB\":\"database\",\"Username\":\"postgres\",\"PassFile\":\"/var/lib/pgadmin/pgpass\",\"SSLMode\":\"prefer\",\"Favorite\":true}}}' > /pgadmin4/servers.json &&
echo 'database:5432:database:postgres:custom_secure_password_123' > /var/lib/pgadmin/pgpass &&
chown 5050:5050 /var/lib/pgadmin/pgpass &&
chmod 600 /var/lib/pgadmin/pgpass &&
/entrypoint.sh
"
ports:
- "5433:80"
volumes: []
networks:
- database-network
restart: unless-stopped
depends_on:
- postgres
postgres:
image: docker.io/sojoner/database:latest
build:
context: .
# For multi-platform builds, specify target platforms
# Comment/remove this line for local single-platform builds
# platforms:
# - linux/amd64
# - linux/arm64
container_name: database
environment:
POSTGRES_PASSWORD: custom_secure_password_123
POSTGRES_DB: database
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
networks:
- database-network
restart: unless-stopped
deploy:
resources:
limits:
cpus: '4.0'
memory: 8G
reservations:
cpus: '2.0'
memory: 4G
shm_size: 2g
volumes:
pgdata:
pgadmin_data:
networks:
database-network:
driver: bridge