forked from WordPress/openverse-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
115 lines (107 loc) · 2.57 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
version: "2.4"
services:
db:
image: postgres:13.2-alpine
ports:
- "5432:5432"
env_file:
- postgres/env.docker
healthcheck:
test: "pg_isready -U deploy -d openledger"
thumbs:
image: willnorris/imageproxy
ports:
- "8222:8222"
command: ["-addr", "0.0.0.0:8222"]
upstream_db:
image: postgres:13.2-alpine
ports:
- "5433:5432"
volumes:
- ./sample_data:/sample_data
env_file:
- postgres/env.docker
healthcheck:
test: "pg_isready -U deploy -d openledger"
cache:
image: redis:4.0.10
ports:
- "6379:6379"
es:
image: docker.elastic.co/elasticsearch/elasticsearch:7.12.0
ports:
- "9200:9200"
environment:
# disable XPack
# https://www.elastic.co/guide/en/elasticsearch/reference/5.3/docker.html#_security_note
- xpack.security.enabled=false
- discovery.type=single-node
healthcheck:
test: ["CMD-SHELL", "curl -si -XGET 'localhost:9200/_cluster/health?pretty' | grep -qE 'yellow|green'"]
interval: 10s
timeout: 60s
retries: 10
ulimits:
nofile:
soft: 65536
hard: 65536
# Memory limit for ES, as it tends to be a memory hoarder
# Set this value to an empty string to remove the limit
# https://docs.docker.com/compose/compose-file/compose-file-v2/#cpu-and-other-resources
mem_limit: ${ES_MEM_LIMIT:-4294967296} # 4 GiB in bytes
web:
build: ./openverse_api/
image: openverse_api
volumes:
- ./openverse_api:/openverse_api
ports:
- "8000:8000"
depends_on:
- db
- es
- cache
env_file:
- openverse_api/env.docker
stdin_open: true
tty: true
ingestion_server:
build: ./ingestion_server/
image: ingestion_server
command: bash -c 'sleep 20 && supervisord -c config/supervisord.conf'
ports:
- "8001:8001"
depends_on:
- db
- es
- indexer_worker
volumes:
- ./ingestion_server:/ingestion_server
env_file:
- ingestion_server/env.docker
stdin_open: true
tty: true
indexer_worker:
build:
context: ./ingestion_server/
dockerfile: Dockerfile_worker
image: indexer_worker
ports:
- "8002:8002"
depends_on:
- db
- es
volumes:
- ./ingestion_server:/ingestion_server
env_file:
- ingestion_server/env.docker
stdin_open: true
tty: true
analytics:
build: ./analytics/
image: analytics
ports:
- "8090:8090"
volumes:
- ./analytics:/analytics
env_file:
- ./analytics/env.docker