File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 1- version : " 3.9"
2-
31services :
42 mysql :
53 build :
@@ -16,6 +14,22 @@ services:
1614 - " 3307:3306"
1715 volumes :
1816 - mysql_data:/var/lib/mysql
17+
18+ mysql-test :
19+ build :
20+ context : ..
21+ dockerfile : docker/MySQL/dockerfile
22+ image : todolist-mysql
23+ container_name : todolist-mysql-test
24+ environment :
25+ MYSQL_ROOT_PASSWORD : root_pass
26+ MYSQL_DATABASE : todolist
27+ MYSQL_USER : app_test
28+ MYSQL_PASSWORD : app_pass_test
29+ ports :
30+ - " 3308:3306"
31+ volumes :
32+ - mysql_data_test:/var/lib/mysql
1933
2034 api :
2135 build :
@@ -32,3 +46,4 @@ services:
3246
3347volumes :
3448 mysql_data :
49+ mysql_data_test :
Original file line number Diff line number Diff line change 77from fastapi .testclient import TestClient
88
99
10- SQLALCHEMY_DATABASE_URL = "mysql+pymysql://app:app_pass @localhost:3307 /todolist"
10+ SQLALCHEMY_DATABASE_URL = "mysql+pymysql://app_test:app_pass_test @localhost:3308 /todolist"
1111
1212engine = create_engine (
1313 SQLALCHEMY_DATABASE_URL ,
You can’t perform that action at this time.
0 commit comments