-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
174 lines (161 loc) · 4.5 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
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# Integral Test Version
version: "3.3"
services:
apigateway-service:
image: apigateway
volumes:
- ./apigateway-service:/home/apigateway
ports:
- 8000:8000
environment:
- PYTHONUNBUFFERED=1
entrypoint: ["bash", "-c"]
restart: always
command:
- |
python manage.py makemigrations --noinput --settings=config.settings.local
python manage.py migrate --noinput --settings=config.settings.local
python manage.py runserver 0.0.0.0:8000 --settings=config.settings.local
# python manage.py loaddata /apigateway/initdata.yaml --settings=config.settings.local
networks:
- test
rabbitmq:
image: rabbitmq:3-management
ports:
- 5672:5672
- 30000:15672
restart: always
networks:
- test
celery_worker:
image: apigateway
volumes:
- ./apigateway-service:/home/apigateway
environment:
- PYTHONUNBUFFERED=1
depends_on:
- apigateway-service
- rabbitmq
networks:
- test
restart: always
entrypoint: ["bash", "-c"]
command:
- |
DJANGO_SETTINGS_MODULE='config.settings.local' celery -A config worker -l info
# profile-service:
# image: profile-service
# volumes:
# - ./profile-service/profile-service:/home/spring
# ports:
# - 8081:8081
# environment:
# SPRING_DATASOURCE_URL: jdbc:mysql://profile-database:3306/profile-db?useUnicode=true&serverTimezone=Asia/Seoul
# SPRING_DATASOURCE_USERNAME: user
# SPRING_DATASOURCE_PASSWORD: 1234
# SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.cj.jdbc.Driver
# SPRING_DATASOURCE_DATABASE_PLATFORM: org.hibernate.dialect.MySQL5Dialect
# depends_on:
# - profile-database
# restart: always
# networks:
# - test
# entrypoint: ["bash", "-c"]
# command:
# - |
# ./gradlew build
# ./gradlew bootRun
# profile-database:
# image: mysql:5.7
# ports:
# - 33060:3306
# environment:
# MYSQL_DATABASE: profile-db
# MYSQL_USER: user
# MYSQL_PASSWORD: 1234
# MYSQL_ROOT_PASSWORD: 1234
# MYSQL_TCP_PORT: 3306
# networks:
# - test
# command: ['--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
investment-service:
image: investment-service
volumes:
- ./investment-service/build/libs/investment-service.jar:/HOME/spring/app.jar
ports:
- 8080:8080
environment:
SPRING_DATASOURCE_URL: jdbc:mysql://investment-database:3307/investment-db?useUnicode=true&serverTimezone=Asia/Seoul
SPRING_DATASOURCE_USERNAME: user
SPRING_DATASOURCE_PASSWORD: 1234
SPRING_DATASOURCE_DRIVER_CLASS_NAME: com.mysql.cj.jdbc.Driver
SPRING_DATASOURCE_DATABASE_PLATFORM: org.hibernate.dialect.MySQL5Dialect
SPRING_SESSION_STORAGE_TYPE: redis
SPRING_REDIS_HOST: investment-redis
SPRING_REDIS_PORT: 6379
depends_on:
- investment-database
- investment-redis
- crawling-service
restart: always
networks:
- test
entrypoint: ["bash", "-c"]
command:
- |
sleep 30s
java -Xms512m -Xms512m -jar app.jar
investment-database:
image: mysql:5.7
ports:
- 33070:3307
environment:
MYSQL_DATABASE: investment-db
MYSQL_USER: user
MYSQL_PASSWORD: 1234
MYSQL_ROOT_PASSWORD: 1234
MYSQL_TCP_PORT: 3307
networks:
- test
command: ['--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci']
investment-redis:
image: redis:6.2.6
ports:
- 6379:6379
networks:
- test
command: [ "redis-server", "--protected-mode", "no" ]
crawling-service:
image: crawling
volumes:
- ./crawling-service:/home/crawling
ports:
- 8001:8001
environment:
- PYTHONUNBUFFERED=1
depends_on:
- investment-database
entrypoint: ["bash", "-c"]
restart: always
command:
- |
sleep 20s
python manage.py makemigrations --noinput --settings=config.settings.local
python manage.py migrate --noinput --settings=config.settings.local
python manage.py runserver 0.0.0.0:8001 --settings=config.settings.local
networks:
- test
# nginx-service:
# image: nginx:1.21.1
# networks:
# - test
# volumes:
# - ./nginx.conf:/etc/nginx/nginx.conf
# ports:
# - 80:80
# - 443:443
# depends_on:
# - apigateway-service
networks:
test:
external: true