docker-compose.yml 616 B

1234567891011121314151617181920212223242526272829
  1. services:
  2. postgres:
  3. image: postgres:15
  4. ports:
  5. - "${DB_PORT:-5432}:5432"
  6. environment:
  7. POSTGRES_USER: username
  8. POSTGRES_PASSWORD: password
  9. POSTGRES_DB: workout_cool
  10. volumes:
  11. - pgdata:/var/lib/postgresql/data
  12. healthcheck:
  13. test: ["CMD-SHELL", "pg_isready -U username -d workout_cool"]
  14. interval: 5s
  15. timeout: 5s
  16. retries: 5
  17. workout_cool:
  18. build:
  19. context: .
  20. dockerfile: Dockerfile
  21. ports:
  22. - "${APP_PORT:-3000}:3000"
  23. depends_on:
  24. postgres:
  25. condition: service_healthy
  26. env_file: .env
  27. volumes:
  28. pgdata: