-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
83 lines (78 loc) · 2.08 KB
/
Copy pathdocker-compose.yml
File metadata and controls
83 lines (78 loc) · 2.08 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
services:
postgres:
image: postgres:16.4-alpine
environment:
POSTGRES_DB: logscope
POSTGRES_USER: app
POSTGRES_PASSWORD: app
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U app -d logscope"]
interval: 5s
timeout: 5s
retries: 20
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.15.3
environment:
discovery.type: single-node
xpack.security.enabled: "false"
ES_JAVA_OPTS: -Xms512m -Xmx512m
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
ports:
- "9200:9200"
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:9200/_cluster/health?wait_for_status=yellow >/dev/null"]
interval: 10s
timeout: 10s
retries: 30
redis:
image: redis:7.4.1-alpine
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 20
api:
build: .
environment:
DATABASE_URL: postgresql+asyncpg://app:app@postgres:5432/logscope
ELASTICSEARCH_URL: http://elasticsearch:9200
REDIS_URL: redis://redis:6379/0
HTTP_HOST: 0.0.0.0
HTTP_PORT: 8080
depends_on:
postgres:
condition: service_healthy
elasticsearch:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "8080:8080"
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8080/ready')"]
interval: 5s
timeout: 5s
retries: 30
worker:
build: .
command: ["logscope-worker"]
environment:
DATABASE_URL: postgresql+asyncpg://app:app@postgres:5432/logscope
ELASTICSEARCH_URL: http://elasticsearch:9200
REDIS_URL: redis://redis:6379/0
depends_on:
postgres:
condition: service_healthy
elasticsearch:
condition: service_healthy
redis:
condition: service_healthy
volumes:
postgres-data:
elasticsearch-data:
redis-data: