feat: Add deploy system
This commit is contained in:
80
compose.deploy.yaml
Normal file
80
compose.deploy.yaml
Normal file
@@ -0,0 +1,80 @@
|
||||
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_Deploy
|
||||
args:
|
||||
TRYTOND_VERSION: ${TRYTOND_VERSION}
|
||||
EMAIL: admin@admin.org
|
||||
WORKER: True
|
||||
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
|
||||
working_dir: /app
|
||||
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:
|
||||
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
|
||||
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
|
||||
working_dir: /app
|
||||
volumes:
|
||||
var:
|
||||
postgres:
|
||||
attachment:
|
||||
Reference in New Issue
Block a user