-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
120 lines (114 loc) · 2.88 KB
/
docker-compose.yaml
File metadata and controls
120 lines (114 loc) · 2.88 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
services:
rabbitmq:
image: rabbitmq:3-management
container_name: rabbitmq
ports:
- 5672:5672
- 15672:15672
networks:
- connecting_network
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "ping"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:6.2-alpine
restart: always
ports:
- "6379:6379"
command: redis-server --save 20 1 --loglevel warning --requirepass eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81
depends_on:
- rabbitmq
networks:
- connecting_network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
redis-insight:
image: redis/redisinsight:latest
restart: always
ports:
- "5540:5540"
networks:
- connecting_network
service1:
build:
context: ./service1
dockerfile: Dockerfile
container_name: service1
ports:
- "3000:3000"
environment:
- PORT=3000
- RABBIT_MQ_URL=amqp://rabbitmq
- REDIS_IP=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81
- SERVICE1_IP=localhost
depends_on:
rabbitmq:
condition: service_healthy
redis:
condition: service_healthy
networks:
- connecting_network
restart: on-failure
# Add a healthcheck for service1 itself
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 10s
timeout: 5s
retries: 3
start_period: 40s # Give it time to start up
service2:
build:
context: ./service2
dockerfile: Dockerfile
container_name: service2
ports:
- "3001:3001"
environment:
- PORT=3001
- RABBIT_MQ_URL=amqp://rabbitmq
- REDIS_IP=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81
- S3_ENDPOINT= # Add your endpoint like nyc3.digitaloceanspaces.com
- S3_BUCKET_NAME= # Add your bucket name like my-bucket
- AWS_ACCESS_KEY_ID= # Add your access key like 3XJ3JXJ3JXJ3JXJ3JXJ3
- AWS_SECRET_ACCESS_KEY= # Add your secret access key like 3XJ3JXJ3JXJ3JXJ3JXJ3
depends_on:
rabbitmq:
condition: service_healthy
redis:
condition: service_healthy
restart: on-failure
networks:
- connecting_network
# Add a healthcheck for service1 itself
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001"]
interval: 10s
timeout: 5s
retries: 3
start_period: 40s # Give it time to start up
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: frontend
ports:
- "5173:5173"
environment:
- VITE_API_URL=http://localhost:3000
depends_on:
- service1
networks:
- connecting_network
networks:
connecting_network:
# Specify driver options
driver: bridge