-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yaml
56 lines (46 loc) · 1.29 KB
/
compose.yaml
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
#https://github.com/chupati/farm-part-3/blob/main/docker-compose.yml
#https://blog.csdn.net/Gf19991225/article/details/121981918
#https://docs.docker.com/compose/compose-file/
#https://www.erraticbits.ca/post/2021/fastapi/
# todo COPY code=>volume mapping, it's slow in MacOS docker desktop, cache isn't effective.
# todo ws connection error in cloud server. https://it.cha138.com/wen2/show-3593816.html should build
version: "3.9"
name: "demo-farm"
services:
mongo:
build:
context: ./db
expose:
- 27017
ports:
- "27017:27017"
fastapi:
depends_on:
- mongo
build:
context: ./backend
expose:
- 8000
ports:
- "8000:8000"
environment:
# access to other container network via db container name, docker network automatically DNS.
- "DATABASE_HOST=mongo"
react:
restart: always
depends_on:
- fastapi
build:
context: ./frontend
dockerfile: Dockerfile
environment:
# ! when production, set it as subdomains name in reverse software.
- "NODE_ENV=production"
- "REACT_APP_API_HTTP=https"
- "REACT_APP_API_PORT=443"
- "REACT_APP_API_HOST=demo-farm-fastapi.zyzypy.com"
ports:
# ! Entrypoint of this whole project,
- "3000:3000"
#networks:
# demo-farm: