-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-dev.yml
47 lines (40 loc) · 1.17 KB
/
docker-compose-dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
version: "3.3"
volumes:
postgres-db:
services:
db:
image: postgres:13
environment:
- POSTGRES_PASSWORD=password1234
- POSTGRES_DB=fastapi
volumes:
- postgres-db:/var/lib/postgresql/data
api:
build: .
depends_on:
- db
ports:
- 8000:8000
volumes:
# this is bind mount to synchronize docker app files with my local app files
- ./:/usr/src/app:ro
command: ["sh", "-c", "alembic upgrade head &&
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload"]
#env_file:
# - ./.env
environment:
# connect to local or server installed postgres db
#- DATABASE_HOSTNAME=localhost
#- DATABASE_PORT=5432
#- DATABASE_PASSWORD=1234
#- DATABASE_NAME=social_media_fastapi
#- DATABASE_USERNAME=postgres
# connect to docker compose service db
- DATABASE_HOSTNAME=db
- DATABASE_PORT=5432
- DATABASE_PASSWORD=password1234
- DATABASE_NAME=fastapi
- DATABASE_USERNAME=postgres
- SECRET_KEY=9b68c9f53ff13f75b890b62af1d9435d65827796d21ceb16c5fe431f054dcde3
- ALGORITHM=HS256
- ACCESS_TOKEN_EXPIRE_MINUTES=60