-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
62 lines (55 loc) · 1.68 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
version: '3.9'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.13.3
environment:
- discovery.type=single-node
ports:
- "${ELASTICSEARCH_PORT}:${ELASTICSEARCH_PORT}"
- "9300:9300"
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:${ELASTICSEARCH_PORT} || exit 1"]
interval: 10s
timeout: 5s
retries: 5
backend:
image: python:3.10
env_file: .env
working_dir: /app
volumes:
- ./back:/app
ports:
- "${BACKEND_PORT}:${BACKEND_PORT}"
command: >
sh -c 'pip install poetry && poetry install && (echo "Waiting for Elasticsearch to be ready..." &&
until curl -s http://elasticsearch:${ELASTICSEARCH_PORT}/_cluster/health | grep -q "\"status\":\"green\|yellow\""; do
echo "Elasticsearch not ready yet, waiting...";
sleep 5;
done) &&
echo "Elasticsearch is ready!";
if [ "$seed" = "true" ]; then
poetry run python -m src.seeder && poetry run python -m src;
else
poetry run python -m src;
fi'
depends_on:
- elasticsearch
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:${BACKEND_PORT} || exit 1"]
interval: 10s
timeout: 5s
retries: 5
frontend:
image: node:16
env_file: .env
working_dir: /app
volumes:
- ./front:/app
ports:
- "${REACT_APP_PORT}:${REACT_APP_PORT}"
command: sh -c "npm install && export PORT=${REACT_APP_PORT} && npm start"
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:${REACT_APP_PORT} || exit 1"]
interval: 10s
timeout: 5s
retries: 5