-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
67 lines (60 loc) · 1.51 KB
/
docker-compose.yml
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
63
64
65
66
version: "3"
services:
frontend:
image: boyuan0926/frontend:latest
build:
context: ./client # 您的 React 應用的路徑
dockerfile: Dockerfile
args:
- REACT_APP_API_URL=http://localhost:3005
- REACT_APP_MOCK_ENV=true
- REACT_APP_CLOUDFRONT_URL="https://dzten4l8yi84s.cloudfront.net"
ports:
- "3000:80" # 假設您的前端應用運行在 3000 端口,這將主機的 3000 端口映射到容器的 3000 端口
networks:
- app-network
mongodb:
image: mongo:latest
ports:
- "27017:27017"
volumes:
- mongo-data:/data/db
networks:
- app-network
redis:
image: redis:latest
ports:
- "6379:6379"
networks:
- app-network
rabbitmq:
image: rabbitmq:3-management
ports:
- "15672:15672" # 管理界面端口
- "5672:5672" # 默认AMQP协议端口
networks:
- app-network
volumes:
- rabbitmq_data:/var/lib/rabbitmq
backend:
image: boyuan0926/backend:latest
build:
context: ./server # 您的 Node.js 應用的路徑
dockerfile: Dockerfile
ports:
- "3005:3005" # 將主機的 3005 端口映射到容器的 3005 端口
networks:
- app-network
depends_on:
- mongodb
- rabbitmq
- redis
env_file: # 指定包含环境变量的文件
- ./server/.env # 这是相对于 docker-compose.yml 文件的路径docker ps
networks:
app-network:
driver: bridge
volumes:
react_build:
mongo-data:
rabbitmq_data: