-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
51 lines (48 loc) · 1.12 KB
/
docker-compose.yml
File metadata and controls
51 lines (48 loc) · 1.12 KB
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
48
49
50
51
version: '3.9'
services:
postgres:
container_name: fastapi-graphql-postgres
image: postgres:14-alpine
restart: unless-stopped
environment:
POSTGRES_HOST: postgres
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
DB: ${DB}
ports:
- 5434:5432
volumes:
- db:/var/lib/postgresql/data
- ./db/init.sql:/docker-entrypoint-initdb.d/create_tables.sql
networks:
- fastapi-graphql
app:
build:
context: .
dockerfile: Dockerfile
ports:
- 8000:8000
container_name: fastapi-graphql
restart: unless-stopped
volumes:
- .:/app
networks:
- fastapi-graphql
environment:
DB_HOST: postgres
DB_PORT: 5432
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME}
JWT_SECRET_KEY: ${JWT_SECRET_KEY}
JWT_ALGORITHM: ${JWT_ALGORITHM}
JWT_ACCESS_TOKEN_EXPIRE_MINUTES: ${JWT_ACCESS_TOKEN_EXPIRE_MINUTES}
SQLALCHEMY_SILENCE_UBER_WARNING: 1
depends_on:
- postgres
volumes:
db:
driver: local
networks:
fastapi-graphql: