Spaces:
Runtime error
Runtime error
| services: | |
| web: | |
| build: . | |
| command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload | |
| volumes: | |
| - .:/code | |
| ports: | |
| - "8000:8000" | |
| environment: | |
| - DATABASE_URL=postgresql://user:password@db:5432/fastapi_db | |
| - POSTGRES_USER=user | |
| - POSTGRES_PASSWORD=password | |
| - POSTGRES_DB=fastapi_db | |
| - REDIS_URL=redis://cache:6379/0 | |
| depends_on: | |
| - db | |
| - cache | |
| db: | |
| image: postgres:15 | |
| volumes: | |
| - postgres_data:/var/lib/postgresql/data | |
| # Note: we don't mount the SQL init into Postgres initdir to avoid | |
| # running schema-creation SQL before Alembic migrations. The web | |
| # container runs migrations first and then applies `sql/init.sql`. | |
| environment: | |
| - POSTGRES_USER=user | |
| - POSTGRES_PASSWORD=password | |
| - POSTGRES_DB=fastapi_db | |
| ports: | |
| - "5432:5432" | |
| pgadmin: | |
| image: dpage/pgadmin4:7 | |
| environment: | |
| PGADMIN_DEFAULT_EMAIL: admin@example.com | |
| PGADMIN_DEFAULT_PASSWORD: admin | |
| ports: | |
| # host:container - change host port if 8080 is already in use on your machine | |
| - "8081:80" | |
| volumes: | |
| - pgadmin_data:/var/lib/pgadmin | |
| depends_on: | |
| - db | |
| cache: | |
| image: redis:7 | |
| ports: | |
| - "6379:6379" | |
| volumes: | |
| - redis_data:/data | |
| volumes: | |
| postgres_data: | |
| redis_data: | |
| pgadmin_data: |