-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathdocker-compose.yml
165 lines (165 loc) · 4.25 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
# This compose allows to build the whole project in a "production"-like environment
services:
server:
build:
context: ./server
expose:
- 4000
restart: on-failure
depends_on:
db:
condition: service_healthy
meilisearch:
condition: service_healthy
mq:
condition: service_healthy
volumes:
- ${DATA_DIR}:${INTERNAL_DATA_DIR}
- ${CONFIG_DIR}:${INTERNAL_CONFIG_DIR}
env_file:
- .env
environment:
- TRANSCODER_URL=http://transcoder:7666
- MEILI_HOST=http://meilisearch:7700
- RABBITMQ_URL=amqp://${RABBITMQ_USER}:${RABBITMQ_PASSWORD}@mq:5672
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public
healthcheck:
test: ["CMD-SHELL", "wget -qO- localhost:4000"]
interval: 5s
timeout: 5s
retries: 5
front:
build:
context: ./front
expose:
- 3000
depends_on:
server:
condition: service_healthy
scanner:
condition: service_healthy
environment:
- PUBLIC_SERVER_URL=${PUBLIC_URL}/api
- SSR_SERVER_URL=http://server:4000
- PUBLIC_SCANNER_URL=${PUBLIC_URL}/scanner
- SSR_SCANNER_URL=http://scanner:8133
scanner:
build:
context: ./scanner
expose:
- 8133
depends_on:
server:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget -qO- localhost:8133"]
interval: 5s
timeout: 5s
retries: 10
environment:
- API_URL=http://server:4000
- INTERNAL_CONFIG_DIR=${INTERNAL_CONFIG_DIR}
- INTERNAL_DATA_DIR=${INTERNAL_DATA_DIR}
- API_KEYS=${API_KEYS}
volumes:
- ${DATA_DIR}:${INTERNAL_DATA_DIR}:ro
- ${CONFIG_DIR}:${INTERNAL_CONFIG_DIR}:ro
matcher:
build:
context: ./matcher
restart: on-failure
depends_on:
server:
condition: service_healthy
mq:
condition: service_healthy
environment:
- API_URL=http://server:4000
- INTERNAL_CONFIG_DIR=${INTERNAL_CONFIG_DIR}
- API_KEYS=${API_KEYS}
- RABBITMQ_URL=amqp://${RABBITMQ_USER}:${RABBITMQ_PASSWORD}@mq:5672
volumes:
- ${CONFIG_DIR}:${INTERNAL_CONFIG_DIR}:ro
transcoder:
image: ghcr.io/zoriya/kyoo_transcoder:master
restart: on-failure
cpus: 1
expose:
- 7666
depends_on:
db:
condition: service_healthy
environment:
- GOCODER_SAFE_PATH=${INTERNAL_DATA_DIR}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_SCHEMA=gocoder
- POSTGRES_SERVER=db
volumes:
- ${DATA_DIR}:${INTERNAL_DATA_DIR}:ro
- transcoder_cache:/cache
profiles: ['', 'cpu']
db:
image: postgres:alpine3.14
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
env_file:
- .env
volumes:
- db:/var/lib/postgresql/data
meilisearch:
image: getmeili/meilisearch:v1.5
restart: on-failure
expose:
- 7700
volumes:
- search:/meili_data
environment:
- MEILI_ENV=production
- MEILI_MASTER_KEY=${MEILI_MASTER_KEY}
- MEILI_LOG_LEVEL=WARN
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--spider", "http://0.0.0.0:7700/health"]
timeout: 5s
retries: 5
mq:
image: rabbitmq:4.0-alpine
environment:
- RABBITMQ_NODENAME=meelo
- RABBITMQ_DEFAULT_USER=${RABBITMQ_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_PASSWORD}
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 5s
timeout: 5s
retries: 10
volumes:
- rabbitmq_data:/var/lib/rabbitmq
nginx:
restart: on-failure
image: nginx:1.24.0-alpine
depends_on:
server:
condition: service_started
front:
condition: service_started
ports:
- ${PORT:-5000}:5000
environment:
- PORT=5000
- FRONT_URL=http://front:3000
- SERVER_URL=http://server:4000
- SCANNER_URL=http://scanner:8133
volumes:
- ./nginx.conf.template:/etc/nginx/templates/meelo.conf.template:ro
volumes:
db:
config:
data:
search:
transcoder_cache:
rabbitmq_data: