-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
62 lines (58 loc) · 1.28 KB
/
docker-compose.yaml
File metadata and controls
62 lines (58 loc) · 1.28 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
52
53
54
55
56
57
58
59
60
61
62
version: "3.8"
services:
api:
build:
context: .
dockerfile: Dockerfile
container_name: fastapi_app
restart: always
ports:
- "8000:8000"
environment:
- DATABASE_URL=mysql+aiomysql://hoplin:hoplin@mysql:3306/fastapi_db
- REDIS_URL=redis://redis:6379/0
- ADMIN_SESSION_SECRET_KEY=admin_secret
- JWT_ISSUER=Hoplin
- JWT_SECRET_KEY=SECRET
- JWT_ALGORITHM=HS256
- JWT_EXPIRE_MINUTE=120
volumes:
- ./app:/app/app
depends_on:
- mysql
- redis
networks:
- app_network
mysql:
image: mysql:8.0
container_name: mysql_db
restart: always
ports:
- "3306:3306"
environment:
- MYSQL_DATABASE=fastapi_db
- MYSQL_USER=hoplin
- MYSQL_PASSWORD=hoplin
- MYSQL_ROOT_PASSWORD=hoplin
volumes:
- mysql_data:/var/lib/mysql
networks:
- app_network
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
redis:
image: redis:7.0
container_name: redis_cache
restart: always
ports:
- "6379:6379"
command: redis-server --requirepass hoplin
volumes:
- redis_data:/data
networks:
- app_network
networks:
app_network:
driver: bridge
volumes:
mysql_data:
redis_data: