-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (66 loc) · 1.54 KB
/
Copy pathdocker-compose.yml
File metadata and controls
71 lines (66 loc) · 1.54 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
services:
nginx:
image: nginx:alpine
ports:
- 80:80
volumes:
- ./frontend:/usr/share/nginx/html
- ./nginx.conf:/etc/nginx/conf.d/default.conf
- ./services/user_service/app/static:/usr/share/nginx/html/static
depends_on:
- api_gateway
networks:
- webnet
api_gateway:
build: ./gateway
volumes:
- ./gateway/app:/app
ports:
- 8080:8000
environment:
- USER_SERVICE_URL=http://user_service:8001
depends_on:
user_service:
condition: service_started
networks:
- webnet
user_service:
build: ./services/user_service
volumes:
- ./services/user_service/app:/app
ports:
- "8001:8001"
environment:
- DATABASE_URL=mysql+asyncmy://${DB_USER}:${DB_PASSWORD}@user_db:3306/user_db
- REDIS_URL=${REDIS_URL}
depends_on:
user_db:
condition: service_healthy
redis_db:
condition: service_started
networks:
- webnet
user_db:
image: mysql:8.0
ports:
- "33061:3306"
restart: always
command: --default-authentication-plugin=mysql_native_password
environment:
- MYSQL_ROOT_PASSWORD=${USER_DB_ROOT_PASSWORD}
- MYSQL_DATABASE=user_db
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PASSWORD}
healthcheck:
test: ["CMD", "mysqladmin", "ping","-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
networks:
- webnet
redis_db:
image: redis:alpine
networks:
- webnet
networks:
webnet: