working with postgres

This commit is contained in:
counterweight 2025-02-08 17:02:59 +01:00
parent d8a72e5978
commit 1ef39baa57
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
6 changed files with 186 additions and 9 deletions

View file

@ -8,6 +8,11 @@ services:
- "3000:3000"
volumes:
- ./container-data:/app/data
networks:
- app_network
depends_on:
postgres:
condition: service_healthy
caddy:
image: caddy:2
@ -17,3 +22,22 @@ services:
- ./caddy:/etc/caddy
depends_on:
- express
postgres:
image: postgres
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "5432:5432"
networks:
- app_network
healthcheck:
test: [ "CMD", "pg_isready", "-U", "${POSTGRES_USER}", "-d", "${POSTGRES_DB}" ] # Check if PostgreSQL is ready
interval: 5s
retries: 3
networks:
app_network:
driver: bridge