add entrypoint.sh for newsblur_web and healthcheck for postgres

This commit is contained in:
Jonathan Math 2021-03-09 12:02:02 -05:00
parent b38daf7bd6
commit 519d4232fc
2 changed files with 10 additions and 1 deletions

View file

@ -25,7 +25,7 @@ services:
expose:
- 8000
# only use gunicorn if the TEST env variable is not "True"
command: bash -c 'if [[ -z "${TEST}" && "${TEST}" = "True" ]] ; then echo "starting test env"; else gunicorn --bind :8000 newsblur_web.wsgi:application; fi'
entrypoint: newsblur_web/entrypoint.sh
volumes:
- app-files:/srv/newsblur
@ -56,6 +56,11 @@ services:
environment:
- POSTGRES_USER=newsblur
- POSTGRES_PASSWORD=newsblur
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
ports:
- 5434:5432
volumes:

View file

@ -0,0 +1,4 @@
if [[ -z "${TEST}" && "${TEST}" = "True" ]]
then echo "starting test env"
else gunicorn --bind :8000 newsblur_web.wsgi:application
fi