docker-compose.yaml 646 B

1234567891011121314151617181920212223242526272829
  1. version: '3.8'
  2. services:
  3. web:
  4. build: .
  5. command: sh start.sh
  6. volumes:
  7. - .:/app
  8. ports:
  9. - 8000:8000
  10. environment:
  11. - DATABASE_URL=postgresql+asyncpg://fastapi_docker:fastapi_docker_pass@db:5432/fastapi_docker
  12. - SERVER_ADDR=0.0.0.0
  13. - SERVER_PORT=8000
  14. depends_on:
  15. - db
  16. db:
  17. image: postgres:15-alpine
  18. volumes:
  19. - postgres_data:/var/lib/postgresql/data/
  20. expose:
  21. - 5432
  22. environment:
  23. - POSTGRES_USER=fastapi_docker
  24. - POSTGRES_PASSWORD=fastapi_docker_pass
  25. - PGPASSWORD=fastapi_docker_pass
  26. - POSTGRES_DB=fastapi_docker
  27. volumes:
  28. postgres_data: