Repository navigation
Expand file tree
/
Copy pathbase.yml
More file actions
161 lines (160 loc) · 5.07 KB
/
Copy pathbase.yml
File metadata and controls
161 lines (160 loc) · 5.07 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
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
# Shared services for all Compose environments (dev, staging, prod).
# The stack is a single monolithic Compose project (project name pinned
# below so volumes and the network keep their `catalog_*` identities).
name: catalog
services:
solr:
build:
context: ./
dockerfile: ./deploy/images/solr.Dockerfile
entrypoint:
- docker-entrypoint.sh
- solr-precreate
- catalog_core
- /catalog-solr-conf
image: comses/catalog/solr:6.6
restart: always
# JVM tuning shared by all environments (previously a swarm config in
# staging.yml and a bind mount in dev.yml; the file is the same either
# way, so it lives here).
volumes:
- solr:/opt/solr/server/solr/mycores
- ./deploy/solr/init.d/solr.in.sh:/opt/solr/bin/solr.in.sh
healthcheck:
# The solr image ships wget (no curl); the cores API answers 200
# only once the core is up and serving.
test: ["CMD-SHELL", "wget -q -O /dev/null http://localhost:8983/solr/admin/cores || exit 1"]
interval: 10s
timeout: 5s
retries: 12
start_period: 60s
redis:
image: redis:8.10.1
restart: always
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.6.2
environment:
- cluster.name=docker-cluster
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
cap_add:
- IPC_LOCK
restart: always
# discovery.zen.minimum_master_nodes=1 in the mounted config file makes
# this a valid single-node cluster (the swarm multi-node discovery env
# vars are gone with the swarm deployment).
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:9200/_cluster/health || exit 1"]
interval: 10s
timeout: 5s
retries: 12
start_period: 40s
volumes:
- ./deploy/elasticsearch.conf.d/log4j2.properties:/usr/share/elasticsearch/config/log4j2.properties
- ./deploy/elasticsearch.conf.d/elasticsearch-dev.yml:/usr/share/elasticsearch/config/elasticsearch.yml
- esdata:/usr/share/elasticsearch/data
elasticsearch8:
image: docker.elastic.co/elasticsearch/elasticsearch:8.15.5
environment:
- cluster.name=docker-cluster8
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
cap_add:
- IPC_LOCK
restart: always
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:9200/_cluster/health || exit 1"]
interval: 10s
timeout: 5s
retries: 12
start_period: 40s
volumes:
- ./deploy/elasticsearch.conf.d/elasticsearch8.yml:/usr/share/elasticsearch/config/elasticsearch.yml
- esdata8:/usr/share/elasticsearch/data
db:
image: postgres:18
volumes:
- ./docker/pgdata:/var/lib/postgresql
restart: always
environment:
POSTGRES_USER: catalog
POSTGRES_PASSWORD_FILE: /run/secrets/catalog_db_password
POSTGRES_DB: comses_catalog
secrets:
- catalog_db_password
healthcheck:
test: ["CMD-SHELL", "pg_isready -U catalog -d comses_catalog"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
django:
volumes:
- solr:/etc/solr/mycores/
- ./docker/shared:/shared
environment:
DJANGO_SETTINGS_MODULE: 'catalog.settings.prod'
LANG: "C.UTF-8"
DB_USER: catalog
DB_HOST: db
DB_NAME: comses_catalog
DB_PORT: 5432
SOLR_HOST: solr
SOLR_PORT: 8983
SOLR_CORE_NAME: catalog_core
ELASTICSEARCH_HOST: elasticsearch8
secrets:
- catalog_django_config
# Required dependencies only. Elasticsearch is deliberately not here:
# the endpoint is per-environment (dev pins elasticsearch8 in
# dev.yml; a staging/prod release selects CATALOG_ES_HOST at render
# time, and Compose cannot pick a depends_on service name from a
# variable). The selected endpoint is waited on exactly where the
# value is known: dev.yml's dependency gate and
# deploy/docker/prod.sh's wait-for-it (ELASTICSEARCH_HOST), so a
# release never blocks on the ES version it does not use.
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
solr:
condition: service_healthy
volumes:
solr:
driver: local
esdata:
driver: local
esdata8:
driver: local
static:
driver: local
# File-based Compose secrets (replace the former external swarm secrets).
# The runtime path /run/secrets/<name> matches the secret name: the app
# reads /run/secrets/catalog_django_config (catalog/settings/base.py) and
# the Postgres entrypoint reads POSTGRES_PASSWORD_FILE
# (/run/secrets/catalog_db_password). The source files are generated by
# `make config-generate`.
secrets:
catalog_django_config:
file: ./deploy/conf/config.ini
catalog_db_password:
file: ./deploy/conf/postgres_password