diff --git a/.env.example b/.env.example index a4beac8..b7a88d7 100644 --- a/.env.example +++ b/.env.example @@ -16,6 +16,9 @@ # # You can define multiple database connections below. +# Docker Demo Database +DATABASE_URL=postgresql://postgres:password@localhost:5432/db_handler_demo + # Production Database DATABASE_URL=postgresql://user:password@localhost:5432/prod_db diff --git a/compose.yml b/compose.yml index d59873e..dcb9334 100644 --- a/compose.yml +++ b/compose.yml @@ -3,8 +3,9 @@ services: image: oven/bun:latest command: bash volumes: - - .:${PWD} - working_dir: ${PWD} + - .:/app + - /app/node_modules + working_dir: /app environment: - TZ=Europe/Paris - LOG_LEVEL=trace @@ -12,4 +13,24 @@ services: - .env tty: true init: true - \ No newline at end of file + depends_on: + postgres: + condition: service_healthy + + postgres: + image: postgres:17-alpine + restart: always + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: password + POSTGRES_DB: db_handler_demo + volumes: + - pg_data:/var/lib/postgresql/data + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 5s + timeout: 5s + retries: 5 + +volumes: + pg_data: