File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 40
40
- docker-service-name : ' chi'
41
41
database-service-name : ' mysql'
42
42
application-port : 3030
43
+ - docker-service-name : ' fastapi'
44
+ database-service-name : ' postgres'
45
+ application-port : 4040
43
46
env :
44
47
# Prevent interference between builds by setting the project name to a unique value. Otherwise
45
48
# "docker compose down" has been stopping containers (especially database) from other builds.
Original file line number Diff line number Diff line change @@ -27,6 +27,15 @@ services:
27
27
retries : 10
28
28
start_period : 1s
29
29
30
+ postgres :
31
+ # https://hub.docker.com/_/postgres
32
+ image : postgres:12-bookworm
33
+ environment :
34
+ - POSTGRES_USER=test
35
+ - POSTGRES_PASSWORD=test
36
+ - POSTGRES_DB=test
37
+ volumes :
38
+ - ./categories.postgres.sql:/docker-entrypoint-initdb.d/categories.sql
30
39
31
40
express-js :
32
41
build : ../examples/js/express/mysql
@@ -69,3 +78,17 @@ services:
69
78
depends_on :
70
79
mysql :
71
80
condition : service_healthy
81
+
82
+ fastapi :
83
+ build : ../examples/python/fastapi/postgres
84
+ environment :
85
+ - DB_NAME=test
86
+ - DB_USER=test
87
+ - DB_PASSWORD=test
88
+ - DB_HOST=postgres # defaults to localhost
89
+ - PORT=4040 # defaults to 3000
90
+ ports :
91
+ - ' 4040:4040'
92
+ depends_on :
93
+ postgres :
94
+ condition : service_healthy
You can’t perform that action at this time.
0 commit comments