Spaces:
Sleeping
Sleeping
version: '3.8' | |
services: | |
db: | |
image: postgres:13 | |
container_name: my_postgres_db | |
environment: | |
POSTGRES_USER: user | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: mydatabase | |
volumes: | |
- postgres_data:/var/lib/postgresql/data | |
- ./init.sql:/docker-entrypoint-initdb.d/init.sql | |
ports: | |
- "5432:5432" | |
healthcheck: | |
test: ["CMD-SHELL", "pg_isready -U user"] | |
interval: 10s | |
timeout: 5s | |
retries: 5 | |
web: | |
build: . | |
container_name: my_web_app_container | |
ports: | |
- "7860:7860" | |
depends_on: | |
db: | |
condition: service_healthy | |
environment: | |
- NODE_ENV=development | |
links: | |
- db | |
networks: | |
- my_network | |
networks: | |
my_network: | |
driver: bridge | |
volumes: | |
postgres_data: |