the strategy for the execution of cron and worker services is changed, in separate dockers
This commit is contained in:
parent
ad90a9ef3e
commit
20279f363d
|
@ -40,4 +40,4 @@ SMTP_FROM=NAME_FROM <mail>
|
|||
SMTP_EMAIL=
|
||||
#NGINX
|
||||
SERVER_NAME=mydomain.org
|
||||
NGINX_PORT=8001
|
||||
NGINX_PORT=8001
|
||||
|
|
|
@ -1,15 +1,5 @@
|
|||
version: '3'
|
||||
services:
|
||||
nginx:
|
||||
image: nginx:1.23.3
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/conf.d/nginx.conf.template
|
||||
ports:
|
||||
- "${NGINX_PORT:-10000}:${NGINX_PORT:-10000}"
|
||||
env_file:
|
||||
- .env
|
||||
command: /bin/bash -c "envsubst < /etc/nginx/conf.d/nginx.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
|
||||
db:
|
||||
image: postgres
|
||||
hostname:
|
||||
|
@ -44,10 +34,9 @@ services:
|
|||
SMTP_PORT: ${SMTP_PORT}
|
||||
SMTP_FROM: ${SMTP_FROM}
|
||||
SMTP_EMAIL: ${SMTP_EMAIL}
|
||||
image: prueba1/prueba:6.6
|
||||
image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
|
||||
ports:
|
||||
- "${TRYTON_PORT:-8000}:8000"
|
||||
- "8010:8010"
|
||||
volumes:
|
||||
- modules:${DIR_MODULES}
|
||||
- var:/var
|
||||
|
@ -56,12 +45,34 @@ services:
|
|||
- db
|
||||
env_file:
|
||||
- .env
|
||||
tryton1:
|
||||
image: prueba1/prueba:6.6
|
||||
depends_on:
|
||||
- db
|
||||
nginx:
|
||||
image: nginx:1.23.3
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/conf.d/nginx.conf.template
|
||||
ports:
|
||||
- "${NGINX_PORT:-10000}:${NGINX_PORT:-10000}"
|
||||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
- tryton
|
||||
command: /bin/bash -c "envsubst < /etc/nginx/conf.d/nginx.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
|
||||
tryton_worker:
|
||||
image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
|
||||
depends_on:
|
||||
- db
|
||||
- tryton
|
||||
entrypoint: [ "bash", "-c", "/entrypoint.sh trytond-worker -c /etc/trytond.conf -d ${POSTGRES_DB} --logconf /etc/trytond_worker_logging.conf"]
|
||||
env_file:
|
||||
- .env
|
||||
tryton_cron:
|
||||
image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
|
||||
depends_on:
|
||||
- db
|
||||
- tryton
|
||||
entrypoint: [ "bash", "-c", "/entrypoint.sh trytond-cron -c /etc/trytond.conf -d ${POSTGRES_DB} --logconf /etc/trytond_cron_logging.conf"]
|
||||
env_file:
|
||||
- .env
|
||||
volumes:
|
||||
modules:
|
||||
var:
|
||||
|
|
13
start.sh
13
start.sh
|
@ -2,18 +2,7 @@
|
|||
|
||||
if [ -s /etc/trytond_populate.conf ]; then
|
||||
if [ "$DEVELOP" == "True" ]; then
|
||||
if [ "$WORKER" == "True" ]; then
|
||||
trytond -c /etc/trytond.conf --dev --logconf /etc/trytond_logging.conf &
|
||||
trytond-cron -c /etc/trytond.conf --dev --logconf /etc/trytond_cron_logging.conf &
|
||||
trytond-worker -c /etc/trytond.conf --dev --logconf /etc/trytond_worker_logging.conf
|
||||
else
|
||||
trytond -c /etc/trytond.conf --dev --logconf /etc/trytond_logging.conf &
|
||||
trytond-cron -c /etc/trytond.conf --dev --logconf /etc/trytond_cron_logging.conf
|
||||
fi
|
||||
elif [ "$WORKER" == "True" ]; then
|
||||
trytond-cron -c /etc/trytond.conf --dev --logconf /etc/trytond_cron_logging.conf &
|
||||
trytond-worker -c /etc/trytond.conf --dev --logconf /etc/trytond_worker_logging.conf &
|
||||
uwsgi --ini /etc/uwsgi.conf
|
||||
trytond -c /etc/trytond.conf --dev --logconf /etc/trytond_logging.conf
|
||||
else
|
||||
uwsgi --ini /etc/uwsgi.conf
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue