-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
105 lines (99 loc) · 2.43 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
services:
web-server:
image: golang:1.23.1
working_dir: /app
ports:
- "8000:8000" # 웹 서버 포트
environment:
GIN_MODE: release
WEB_SERVER_PORT: 8000
RABBITMQ_URL: "amqp://guest:guest@rabbitmq:5672/"
CRAWLER_SERVER_URL: "http://crawler-server:8080"
QUEUE_NAMES: "cse-notices,sw-notices"
TZ: "Asia/Seoul" # 한국 시간대 설정
volumes:
- ./web-server:/app
command: >
sh -c "
go mod tidy &&
go run main.go"
restart: always
depends_on:
rabbitmq:
condition: service_healthy
crawler-server:
condition: service_started
networks:
- app_network
crawler-server:
image: golang:1.23.1
working_dir: /app
ports:
- "8080:8080" # 크롤러 서버 포트
environment:
CRAWLER_SERVER_PORT: 8080
MYSQL_HOST: db
MYSQL_PORT: 3306
MYSQL_USER: mydb
MYSQL_PASSWORD: securepassword
MYSQL_DATABASE: mydb
RABBITMQ_URL: "amqp://guest:guest@rabbitmq:5672/"
TZ: "Asia/Seoul" # 한국 시간대 설정
volumes:
- ./crawler-server:/app
command: >
sh -c "
go mod tidy &&
go run main.go"
restart: always
depends_on:
db:
condition: service_healthy
rabbitmq:
condition: service_healthy
networks:
- app_network
rabbitmq:
image: rabbitmq:3-management
container_name: rabbitmq
ports:
- "5672:5672"
- "15672:15672"
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
TZ: "Asia/Seoul" # 한국 시간대 설정
healthcheck:
test: ["CMD", "rabbitmqctl", "status"]
interval: 10s
timeout: 5s
retries: 5
networks:
- app_network
db:
image: mysql:8.1
container_name: db
ports:
- "13306:3306"
environment:
MYSQL_ROOT_PASSWORD: securepassword
MYSQL_DATABASE: mydb
MYSQL_USER: mydb
MYSQL_PASSWORD: securepassword
TZ: "Asia/Seoul" # 한국 시간대 설정
volumes:
- mysql_data:/var/lib/mysql
- ./_tools/mysql/conf.d:/etc/mysql/conf.d:cached
- ./_tools/mysql/schema.sql:/docker-entrypoint-initdb.d/schema.sql
restart: always
networks:
- app_network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
volumes:
mysql_data:
networks:
app_network: