add check healthy to container tryton

This commit is contained in:
Rodia 2023-06-14 21:52:22 -05:00
parent 22d829554f
commit ee77bb24bd

View file

@ -35,9 +35,14 @@ services:
SMTP_FROM: ${SMTP_FROM} SMTP_FROM: ${SMTP_FROM}
SMTP_EMAIL: ${SMTP_EMAIL} SMTP_EMAIL: ${SMTP_EMAIL}
image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION} image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
healthcheck:
test: curl --fail localhost:${TRYTON_PORT} || exit 1
interval: 30s
retries: 5
start_period: 30s
timeout: 20s
ports: ports:
- "${TRYTON_PORT:-8000}:8000" - "${TRYTON_PORT:-8000}:8000"
- "8010:8010"
volumes: volumes:
- modules:${DIR_MODULES} - modules:${DIR_MODULES}
- var:/var - var:/var
@ -61,16 +66,16 @@ services:
tryton_worker: tryton_worker:
image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION} image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
depends_on: depends_on:
- db tryton:
- tryton condition: service_healthy
entrypoint: [ "bash", "-c", "/entrypoint.sh trytond-worker -c /etc/trytond.conf -d ${POSTGRES_DB} --logconf /etc/trytond_worker_logging.conf"] entrypoint: [ "bash", "-c", "/entrypoint.sh trytond-worker -c /etc/trytond.conf -d ${POSTGRES_DB} --logconf /etc/trytond_worker_logging.conf"]
env_file: env_file:
- .env - .env
tryton_cron: tryton_cron:
image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION} image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
depends_on: depends_on:
- db tryton:
- tryton condition: service_healthy
entrypoint: [ "bash", "-c", "/entrypoint.sh trytond-cron -c /etc/trytond.conf -d ${POSTGRES_DB} --logconf /etc/trytond_cron_logging.conf"] entrypoint: [ "bash", "-c", "/entrypoint.sh trytond-cron -c /etc/trytond.conf -d ${POSTGRES_DB} --logconf /etc/trytond_cron_logging.conf"]
env_file: env_file:
- .env - .env