forked from ImFineThxAndYou/server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
126 lines (113 loc) · 3.24 KB
/
Copy pathdocker-compose.yml
File metadata and controls
126 lines (113 loc) · 3.24 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
version: "3.9"
services:
postgres:
image: postgres:15
restart: unless-stopped
environment:
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME} -d ${DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:8
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redisdata:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
libretranslate:
image: libretranslate/libretranslate:latest
restart: unless-stopped
user: "0:0" # ← root 로 실행(볼륨 쓰기 권한 문제 해결)
ports:
- "5001:5000" # host 5001 -> container 5000
environment:
LT_LOAD_ONLY: "en,ko" # en/ko만 사용
LT_PRELOAD: "true" # 기동 시 en<->ko 모델 미리 로드
LT_UPDATE_MODELS: "true"
command: ["--host", "0.0.0.0", "--port", "5000"]
volumes:
- lt_models:/home/libretranslate/.local/share/argos-translate
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:5000/languages | grep -q '\"code\":\"ko\"' && grep -q '\"code\":\"en\"'"]
interval: 20s
timeout: 5s
retries: 10
spacy-api:
build:
context: ./spacy-api
container_name: spacy-api
restart: unless-stopped
volumes:
- ./spacy-api:/app
ports:
- "8000:8000"
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8000/health" ]
interval: 10s
timeout: 5s
retries: 3
fastapi-api:
build:
context: ./fastapi-api
container_name: fastapi-api
restart: unless-stopped
ports:
- "8001:8001"
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8001/health" ]
interval: 10s
timeout: 5s
retries: 3
zookeeper:
image: bitnami/zookeeper:3.9
container_name: zookeeper
restart: unless-stopped
ports:
- "2181:2181"
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
networks:
- kafka-net
kafka:
image: bitnami/kafka:3.7
container_name: kafka
restart: unless-stopped
ports:
- "9092:9092" # 컨테이너 내부/다른 컨테이너용
- "9094:9094" # 호스트 접속용
environment:
# Zookeeper 연결
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
# 브로커 ID
- KAFKA_BROKER_ID=1
# Listener 설정 (컨테이너 내부와 외부 둘 다)
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,PLAINTEXT_HOST://:9094
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:9094
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=PLAINTEXT
# 자동 토픽 생성 허용
- KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true
depends_on:
- zookeeper
networks:
- kafka-net
volumes:
pgdata:
redisdata:
lt_models:
networks:
kafka-net: