-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
114 lines (106 loc) · 2.71 KB
/
docker-compose.yaml
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
version: "3.8"
services:
frontend:
build:
context: frontend/.
dockerfile: Dockerfile
container_name: my-web-frontend
ports:
- 3000:3000
networks:
trenddit_network:
ipv4_address:
172.18.0.12
volumes:
- ./frontend:/workspace
command: npm start
server:
build:
context: server/.
dockerfile: Dockerfile
container_name: my-web-server
ports:
- 8000:8000
networks:
trenddit_network:
ipv4_address:
172.18.0.2
volumes:
- ./server:/workspace
command: uvicorn main:app --host 0.0.0.0 --reload
depends_on:
database:
condition: service_healthy # 데이터베이스가 정상적으로 실행될 때까지 대기
database:
build:
context: database/.
dockerfile: Dockerfile
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ALLOW_EMPTY_PASSWORD=${MYSQL_ALLOW_EMPTY_PASSWORD}
- MYSQL_RANDOM_ROOT_PASSWORD=${MYSQL_RANDOM_ROOT_PASSWORD}
container_name: my-web-database-mysql
ports:
- 3306:3306
networks:
trenddit_network:
ipv4_address:
172.18.0.3
volumes:
- ./database:/workspace
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h localhost -u${MYSQL_USER} -p${MYSQL_PASSWORD}"] # 데이터베이스 헬스체크
naverkeyword:
build:
context: crawl/.
dockerfile: Dockerfile
container_name: my-web-naver-keyword
volumes:
- ./crawl:/workspace
command: >
bash -c "python3 naverKeyword.py
&& python3 naverDictionary.py
&& python3 naverArticleRank.py"
# # Hadoop
# namenode:
# image: apache/hadoop:3
# hostname: namenode
# command: ["hdfs", "namenode"]
# ports:
# - 9870:9870
# env_file:
# - ./hadoop/config
# environment:
# ENSURE_NAMENODE_DIR: "/tmp/hadoop-root/dfs/name"
# datanode1:
# image: apache/hadoop:3
# command: ["hdfs", "datanode"]
# env_file:
# - ./hadoop/config
# datanode2:
# image: apache/hadoop:3
# command: ["hdfs", "datanode"]
# env_file:
# - ./hadoop/config
# resourcemanager:
# image: apache/hadoop:3
# hostname: resourcemanager
# command: ["yarn", "resourcemanager"]
# ports:
# - 8088:8088
# env_file:
# - ./hadoop/config
# volumes:
# - ./test.sh:/opt/test.sh
# nodemanager:
# image: apache/hadoop:3
# command: ["yarn", "nodemanager"]
# env_file:
# - ./hadoop/config
########################################
networks:
trenddit_network:
external: true