docker-tryton/docker-compose.yml.sample
Sergio Morillo 0352849b0d Migrate to 5.4
This commit refs #12039
2020-02-24 17:20:59 +01:00

118 lines
2.9 KiB
Plaintext

version: '3'
services:
postgres:
image: postgres:12
container_name: postgres
restart:
always
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- TRYTON_DB_USER=${TRYTON_DB_USER}
- TRYTON_DB_PASSWORD=${TRYTON_DB_PASSWORD}
- TRYTON_DB_NAME=${TRYTON_DB_NAME}
volumes:
- ./sql_init_scripts:/docker-entrypoint-initdb.d
- /var/lib/pgsql/11/data:/var/lib/postgresql/data
ports:
- "5432:5432"
shm_size: '128mb'
tryton:
build: .
image: tryton:${VERSION}-deploy
container_name: tryton
environment:
DB_USER: ${TRYTON_DB_USER}
DB_PASSWORD: ${TRYTON_DB_PASSWORD}
DB_HOSTNAME: postgres
TRYTOND_DATABASE__LANGUAGE: ${TRYTON_LANGUAGE}
# <<<< comment to use trytond without uwsgi
expose:
- "8000"
# >>>> finish comment
# <<<< uncomment to use trytond without uwsgi
# ports:
# - "8000:8000"
# entrypoint:
# /entrypoint.sh trytond
# >>>> finish uncomment
depends_on:
- postgres
volumes:
- db:/home/trytond/db
- code:/home/trytond/tryton
restart:
unless-stopped
nginx:
image: nginx:latest
container_name: nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
# <<<< uncomment to use ssl and certbot
# - ./certbot/conf:/etc/letsencrypt
# - ./certbot/www:/var/www/certbot
# command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
# >>>> finish uncomment
ports:
- 80:80
- 8000:8000
# <<<< uncomment to use ssl and certbot >>>>
# - 443:443
depends_on:
- tryton
restart:
unless-stopped
# <<<< uncomment to use ssl and certbot
# certbot:
# image: certbot/certbot
# volumes:
# - ./certbot/conf:/etc/letsencrypt
# - ./certbot/www:/var/www/certbot
# entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
# >>>> finish uncomment
tryton-cron:
build: .
image: tryton:${VERSION}-deploy
container_name: tryton-cron
environment:
DB_USER: ${TRYTON_DB_USER}
DB_PASSWORD: ${TRYTON_DB_PASSWORD}
DB_HOSTNAME: postgres
TRYTOND_DATABASE__LANGUAGE: ${TRYTON_LANGUAGE}
depends_on:
- postgres
entrypoint:
/entrypoint.sh trytond-cron -d ${TRYTON_DB_NAME}
volumes:
- db:/home/trytond/db
- code:/home/trytond/tryton
restart:
unless-stopped
tryton-worker:
build: .
image: tryton:${VERSION}-deploy
container_name: tryton-worker
environment:
DB_USER: ${TRYTON_DB_USER}
DB_PASSWORD: ${TRYTON_DB_PASSWORD}
DB_HOSTNAME: postgres
TRYTOND_DATABASE__LANGUAGE: ${TRYTON_LANGUAGE}
depends_on:
- postgres
entrypoint:
/entrypoint.sh trytond-worker -d ${TRYTON_DB_NAME}
volumes:
- db:/home/trytond/db
- code:/home/trytond/tryton
restart:
unless-stopped
volumes:
db:
code: