Skip to content

Commit e1568fd

Browse files
committedApr 17, 2022
Add healthchecks
1 parent 0e81cd0 commit e1568fd

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed
 

‎contrib/docker/docker-compose.yml

+12-5
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ services:
1414
container_name: ckan
1515
build:
1616
context: ../../
17-
links:
18-
- db
19-
- solr
20-
- redis
2117
depends_on:
22-
- db
18+
db:
19+
condition: service_healthy
20+
solr:
21+
condition: service_healthy
22+
redis:
23+
condition: service_healthy
2324
ports:
2425
- "0.0.0.0:${CKAN_PORT}:5000"
2526
environment:
@@ -36,6 +37,8 @@ services:
3637
- DS_RO_PASS=${DATASTORE_READONLY_PASSWORD}
3738
- POSTGRES_HOST=${POSTGRES_HOST}
3839
restart: unless-stopped
40+
healthcheck:
41+
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5000"]
3942
# Debug with pdb (example) - Interact with `docker attach $(docker container ls -qf name=ckan)`
4043
#command: 'python -m pdb /usr/lib/ckan/venv/bin/ckan --config /etc/ckan/production.ini run --host 0.0.0.0 --passthrough-errors'
4144
#tty: true
@@ -76,8 +79,12 @@ services:
7679
volumes:
7780
- solr_data:/opt/solr/server/solr/ckan/data
7881
restart: unless-stopped
82+
healthcheck:
83+
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:8983/solr/"]
7984

8085
redis:
8186
container_name: redis
8287
image: redis:6.2
8388
restart: unless-stopped
89+
healthcheck:
90+
test: ["CMD", "redis-cli", "-e", "QUIT"]

0 commit comments

Comments
 (0)
Please sign in to comment.