Files
NaliiaERP/docker-compose.prod.yaml
2026-06-18 17:43:49 -05:00

103 lines
2.8 KiB
YAML

services:
db:
image: postgres
hostname: ${DB_HOSTNAME}
volumes:
- postgres:/var/lib/postgresql
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
tryton:
build:
context: ./
dockerfile: Dockerfile_prod
args:
TRYTOND_VERSION: ${TRYTOND_VERSION}
GITEA_USER: ${GITEA_USER}
GITEA_PASSWORD: ${GITEA_PASSWORD}
GITEA_DOMAIN: ${GITEA_DOMAIN}
WORKER: ${WORKER}
TRYTONPASSFILE: ${TRYTONPASSFILE}
TRYTON_ADMIN_EMAIL: ${TRYTON_ADMIN_EMAIL}
SMTP: ${SMTP}
SMTP_TYPE: ${SMTP_TYPE}
SMTP_USER: ${SMTP_USER}
SMTP_PASSWORD: ${SMTP_PASSWORD}
SMTP_DOMAIN: ${SMTP_DOMAIN}
SMTP_PORT: ${SMTP_PORT}
SMTP_FROM: ${SMTP_FROM}
SMTP_EMAIL: ${SMTP_EMAIL}
image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
healthcheck:
test: curl --fail localhost:8000 || exit 1
interval: 30s
retries: 5
start_period: 30s
timeout: 20s
ports:
- "${TRYTON_PORT:-8000}:8000"
volumes:
- .:/app
- var:/var
- attachment:/mnt/attachment
environment:
- TRYTOND_DATABASE_URI=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOSTNAME}:5432/
depends_on:
- db
env_file:
- .env.production
working_dir: /app
nginx:
image: nginx:1.23.3
restart: unless-stopped
volumes:
- ./prod/nginx.conf:/etc/nginx/conf.d/nginx.conf.template
ports:
- "${NGINX_PORT:-10000}:${NGINX_PORT:-10000}"
env_file:
- .env.production
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:
tryton:
condition: service_healthy
entrypoint:
[
"bash",
"-c",
"/entrypoint.sh trytond-worker -c /etc/trytond_worker.conf -d ${POSTGRES_DB} --logconf /etc/trytond_worker_logging.conf",
]
volumes:
- .:/app
environment:
- TRYTOND_DATABASE_URI=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOSTNAME}:5432/
env_file:
- .env.production
working_dir: /app
tryton_cron:
image: tryton/${POSTGRES_DB}:${TRYTOND_VERSION}
depends_on:
tryton:
condition: service_healthy
entrypoint:
[
"bash",
"-c",
"/entrypoint.sh trytond-cron -c /etc/trytond.conf -d ${POSTGRES_DB} --logconf /etc/trytond_cron_logging.conf",
]
volumes:
- .:/app
environment:
- TRYTOND_DATABASE_URI=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${DB_HOSTNAME}:5432/
env_file:
- .env.production
working_dir: /app
volumes:
app:
var:
postgres:
attachment: