Assign PostgreSQL its own network and static ip

This commit is contained in:
moshferatu 2024-01-09 13:10:50 -08:00
parent 3ba247dedc
commit 5817e697b7

View File

@ -10,6 +10,9 @@ services:
POSTGRES_DB:
volumes:
- <docker directory>/postgresql/data:/var/lib/postgresql/data
networks:
postgresql:
ipv4_address: <static ip>
ports:
- "5432:5432"
pgadmin:
@ -21,5 +24,14 @@ services:
PGADMIN_DEFAULT_PASSWORD:
volumes:
- <docker directory>/pgadmin:/var/lib/pgadmin
networks:
postgresql:
ipv4_address: <static ip>
ports:
- "5050:80"
- "5050:80"
networks:
postgresql:
name: postgresql
ipam:
config:
- subnet: <subnet>