You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
660 B
YAML
28 lines
660 B
YAML
version: '3.8'
|
|
|
|
services:
|
|
|
|
web:
|
|
build: ./project
|
|
command: uvicorn app.main:app --reload --workers 1 --host 0.0.0.0 --port 8000
|
|
volumes:
|
|
- ./project:/usr/src/app
|
|
ports:
|
|
- 8004:8000
|
|
environment:
|
|
# This is the synchronous uri we started with
|
|
# - DATABASE_URL=postgresql://postgres:postgres@db:5432/foo
|
|
# This is the async uri after installing asyncpg
|
|
- DATABASE_URL=postgresql+asyncpg://postgres:postgres@db:5432/foo
|
|
depends_on:
|
|
- db
|
|
|
|
db:
|
|
image: postgres:13.4
|
|
expose:
|
|
- 5432
|
|
environment:
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_PASSWORD=postgres
|
|
- POSTGRES_DB=foo
|