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=
|
SMTP_EMAIL=
|
||||||
#NGINX
|
#NGINX
|
||||||
SERVER_NAME=mydomain.org
|
SERVER_NAME=mydomain.org
|
||||||
NGINX_PORT=8001
|
NGINX_PORT=8001
|
||||||
|
|
|
@ -1,15 +1,5 @@
|
||||||
version: '3'
|
version: '3'
|
||||||
services:
|
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:
|
db:
|
||||||
image: postgres
|
image: postgres
|
||||||
hostname:
|
hostname:
|
||||||
|
@ -44,10 +34,9 @@ services:
|
||||||
SMTP_PORT: ${SMTP_PORT}
|
SMTP_PORT: ${SMTP_PORT}
|
||||||
SMTP_FROM: ${SMTP_FROM}
|
SMTP_FROM: ${SMTP_FROM}
|
||||||
SMTP_EMAIL: ${SMTP_EMAIL}
|
SMTP_EMAIL: ${SMTP_EMAIL}
|
||||||
image: prueba1/prueba:6.6
|
image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
|
||||||
ports:
|
ports:
|
||||||
- "${TRYTON_PORT:-8000}:8000"
|
- "${TRYTON_PORT:-8000}:8000"
|
||||||
- "8010:8010"
|
|
||||||
volumes:
|
volumes:
|
||||||
- modules:${DIR_MODULES}
|
- modules:${DIR_MODULES}
|
||||||
- var:/var
|
- var:/var
|
||||||
|
@ -56,12 +45,34 @@ services:
|
||||||
- db
|
- db
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
tryton1:
|
nginx:
|
||||||
image: prueba1/prueba:6.6
|
image: nginx:1.23.3
|
||||||
depends_on:
|
restart: unless-stopped
|
||||||
- db
|
volumes:
|
||||||
|
- ./nginx.conf:/etc/nginx/conf.d/nginx.conf.template
|
||||||
|
ports:
|
||||||
|
- "${NGINX_PORT:-10000}:${NGINX_PORT:-10000}"
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .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:
|
volumes:
|
||||||
modules:
|
modules:
|
||||||
var:
|
var:
|
||||||
|
|
13
start.sh
13
start.sh
|
@ -2,18 +2,7 @@
|
||||||
|
|
||||||
if [ -s /etc/trytond_populate.conf ]; then
|
if [ -s /etc/trytond_populate.conf ]; then
|
||||||
if [ "$DEVELOP" == "True" ]; then
|
if [ "$DEVELOP" == "True" ]; then
|
||||||
if [ "$WORKER" == "True" ]; then
|
trytond -c /etc/trytond.conf --dev --logconf /etc/trytond_logging.conf
|
||||||
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
|
|
||||||
else
|
else
|
||||||
uwsgi --ini /etc/uwsgi.conf
|
uwsgi --ini /etc/uwsgi.conf
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue