-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
128 lines (121 loc) · 3.28 KB
/
docker-compose.yml
File metadata and controls
128 lines (121 loc) · 3.28 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
121
122
123
124
125
126
127
128
services:
rabbitmq:
image: rabbitmq:3-management
container_name: skillsync-rabbitmq
hostname: rabbitmq
ports:
- "5672:5672"
- "15672:15672"
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping" ]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
volumes:
- ./docker/rabbitmq.conf:/etc/rabbitmq/conf.d/10-defaults.conf
postgres:
image: postgres:15
container_name: skillsync-postgres
ports:
- "5433:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
- ./docker/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 10
start_period: 10s
auth-service:
build:
context: .
dockerfile: ./services/auth-service/Dockerfile
container_name: skillsync-auth-service
ports:
- "3001:3001"
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/auth_db?schema=public
JWT_SECRET: supersecret
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
restart: unless-stopped
user-service:
build:
context: .
dockerfile: ./services/user-service/Dockerfile
container_name: skillsync-user-service
ports:
- "3002:3002"
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/user_db?schema=public
JWT_SECRET: supersecret
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
restart: unless-stopped
project-service:
build:
context: .
dockerfile: ./services/project-service/Dockerfile
container_name: skillsync-project-service
ports:
- "3003:3003"
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/project_db?schema=public
JWT_SECRET: supersecret
RABBITMQ_URL: amqp://guest:guest@rabbitmq:5672
depends_on:
postgres:
condition: service_healthy
rabbitmq:
condition: service_healthy
restart: unless-stopped
api-gateway:
build:
context: .
dockerfile: ./api-gateway/Dockerfile
container_name: skillsync-api-gateway
ports:
- "3000:3000"
environment:
JWT_SECRET: supersecret
AUTH_SERVICE_URL: http://auth-service:3001
USER_SERVICE_URL: http://user-service:3002
PROJECT_SERVICE_URL: http://project-service:3003
depends_on:
auth-service:
condition: service_started
user-service:
condition: service_started
project-service:
condition: service_started
restart: unless-stopped
frontend:
build:
context: ./frontend
container_name: skillsync-frontend
ports:
- "5173:5173"
environment:
VITE_API_URL: http://localhost:3000
depends_on:
api-gateway:
condition: service_started
restart: unless-stopped
volumes:
postgres_data: