This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
/
docker-compose.yml
137 lines (129 loc) · 3.14 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
version: "2.4"
services:
db:
image: postgres:13.2-alpine
ports:
- "50254:5432"
env_file:
- postgres/env.docker
healthcheck:
test: "pg_isready -U deploy -d openledger"
volumes:
- api-postgres:/var/lib/postgresql/data
upstream_db:
image: postgres:13.2-alpine
expose:
- "5432"
volumes:
- catalog-postgres:/var/lib/postgresql/data
- ./sample_data:/sample_data
env_file:
- postgres/env.docker
healthcheck:
test: "pg_isready -U deploy -d openledger"
cache:
image: redis:4.0.10
ports:
- "50263:6379"
es:
image: docker.elastic.co/elasticsearch/elasticsearch:7.12.0
ports:
- "50292: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
- http.cors.enabled=true
- http.cors.allow-origin=/.*/
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
volumes:
- es-data:/usr/share/elasticsearch/data
web:
build:
context: ./api/
args:
SEMANTIC_VERSION: ${SEMANTIC_VERSION:-v1.0.0}
image: openverse-api
volumes:
- ./api:/api
ports:
- "50280:8000" # Django
- "50230:3000" # Sphinx (unused by default; see `sphinx-live` recipe)
depends_on:
- db
- es
- cache
env_file:
- api/env.docker
- api/.env
environment:
STATIC_ROOT: ${STATIC_ROOT:-}
MEDIA_ROOT: ${MEDIA_ROOT:-}
stdin_open: true
tty: true
ingestion_server:
build: ./ingestion_server/
image: openverse-ingestion_server
command: gunicorn -c ./gunicorn.conf.py
ports:
- "50281:8001"
depends_on:
- db
- upstream_db
- es
- indexer_worker
volumes:
- ./ingestion_server:/ingestion_server
env_file:
- ingestion_server/env.docker
stdin_open: true
tty: true
indexer_worker:
build: ./ingestion_server/
image: openverse-ingestion_server
command: gunicorn -c ./gunicorn_worker.conf.py
expose:
- "8002"
depends_on:
- db
- upstream_db
- es
volumes:
- ./ingestion_server:/ingestion_server
env_file:
- ingestion_server/env.docker
stdin_open: true
tty: true
proxy:
image: nginx:alpine
ports:
- "50200:9080"
- "50243:9443"
environment:
HTTPS_PORT: 50243 # See `ports` mapping above.
depends_on:
- web
volumes:
- ./nginx/templates:/etc/nginx/templates
- ./nginx/certs:/etc/nginx/certs
volumes:
api-postgres:
catalog-postgres:
es-data: