61 lines
1.3 KiB
YAML
61 lines
1.3 KiB
YAML
name: pg_and_pgadmin
|
|
services:
|
|
pg:
|
|
image: postgres:17.0-bookworm
|
|
container_name: postgres_new
|
|
environment:
|
|
POSTGRES_USER: kolchin
|
|
POSTGRES_PASSWORD: postgres
|
|
PGDATA: /var/lib/postgresql/data/pgdata
|
|
volumes:
|
|
- pg-data:/var/lib/postgresql/data
|
|
- ./db/:/docker-entrypoint-initdb.d
|
|
restart: unless-stopped
|
|
networks:
|
|
- pg-net
|
|
#ipv4_address: 192.168.100.2
|
|
ports:
|
|
- 10500:5432
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U kolchin"]
|
|
interval: 5s
|
|
timeout: 10s
|
|
retries: 3
|
|
pgadmin:
|
|
image: dpage/pgadmin4:8.12.0
|
|
container_name: pgadmin_new
|
|
environment:
|
|
PGADMIN_DEFAULT_EMAIL: user@example.com
|
|
PGADMIN_DEFAULT_PASSWORD: postgres
|
|
ports:
|
|
- 10501:80
|
|
restart: unless-stopped
|
|
networks:
|
|
- pg-net
|
|
#ipv4_address: 192.168.100.3
|
|
depends_on:
|
|
pg:
|
|
condition: service_healthy
|
|
app:
|
|
build:
|
|
context: ./
|
|
args:
|
|
PYTHON_VERSION: "3.10"
|
|
UID: 10002
|
|
container_name: python-app
|
|
networks:
|
|
- pg-net
|
|
#ipv4_address: 192.168.100.4
|
|
depends_on:
|
|
pg:
|
|
condition: service_healthy
|
|
volumes:
|
|
pg-data:
|
|
networks:
|
|
pg-net:
|
|
driver: bridge
|
|
#ipam:
|
|
# config:
|
|
# - subnet: 192.168.100.0/24
|
|
# - gateway: 192.168.100.1
|