From c6c4c000b85f8906cf811d3701662d07448314aa Mon Sep 17 00:00:00 2001 From: AthulyaMS Date: Thu, 18 Jul 2024 12:38:25 +0530 Subject: [PATCH] updated production docker compose --- docker/docker-compose-production.yml | 604 +++++++++++++++++++++++++++ 1 file changed, 604 insertions(+) diff --git a/docker/docker-compose-production.yml b/docker/docker-compose-production.yml index e69de29bb..098b61c05 100644 --- a/docker/docker-compose-production.yml +++ b/docker/docker-compose-production.yml @@ -0,0 +1,604 @@ +version: '3.9' +services: + kratos-postgresd: + image: postgres:9.6 + ports: + - "5432:5432" + expose: + - 5432 + restart: always + environment: + - POSTGRES_USER=${VACHAN_KRATOS_DB_USER:-kratos} + - POSTGRES_PASSWORD=${VACHAN_KRATOS_DB_PASSWORD:-secret} + - POSTGRES_DB=${VACHAN_KRATOS_DB_NAME:-kratos} + - POSTGRES_HOST_AUTH_METHOD=md5 + volumes: + - kratos-postgres-vol:/var/lib/postgresql/data + - kratos-db-backup:/var/backups:rw + labels: + ofelia.enabled: "true" + ofelia.job-exec.kratos-backup.schedule: "0 0 1 * * *" #"Takes a single dump within the db container every day at 01:00 am" + ofelia.job-exec.kratos-backup.command: "pg_dump --dbname=postgresql://$VACHAN_KRATOS_DB_USER:$VACHAN_KRATOS_DB_PASSWORD@localhost:5432/$VACHAN_KRATOS_DB_NAME --file=/var/backups/kratos_db_backup_latest.sql" + networks: + - VE-network + + kratos-migrate: + image: oryd/kratos:v1.0.0 + environment: + - DSN=${VACHAN_AUTH_DATABASE:-postgres://kratos:secret@kratos-postgresd:5432/kratos?sslmode=disable&max_conns=20&max_idle_conns=4} + volumes: + - type: volume + source: kratos-sqlite + target: /var/lib/sqlite + read_only: false + - type: bind + source: ./Kratos_config/email-password + target: /etc/config/kratos + command: -c /etc/config/kratos/kratos.yml migrate sql -e --yes + restart: on-failure + links: + - kratos-postgresd + depends_on: + - kratos-postgresd + networks: + - VE-network + + kratos: + image: oryd/kratos:v1.0.0 + ports: + - '4433:4433' # public + - '4434:4434' # admin + restart: unless-stopped + environment: + - DSN=${VACHAN_AUTH_DATABASE:-postgres://kratos:secret@kratos-postgresd:5432/kratos?sslmode=disable&max_conns=20&max_idle_conns=4} + - LOG_LEVEL=trace + - COURIER_SMTP_CONNECTION_URI=${VACHAN_SUPPORT_EMAIL_CREDS:-smtps://test:test@mailslurper:1025/?skip_ssl_verify=true&legacy_ssl=true} + - COURIER_SMTP_FROM_ADDRESS=${VACHAN_SUPPORT_EMAIL:-EMAIL_ADDRESS@bridgeconn.com} + - SERVE_PUBLIC_BASE_URL=http://kratos:4433 + command: serve -c /etc/config/kratos/kratos.yml --watch-courier + volumes: + - type: bind + source: ./Kratos_config/email-password + target: /etc/config/kratos + links: + - kratos-postgresd + depends_on: + - kratos-postgresd + expose: + - 4434 + - 4433 + networks: + - VE-network + + vachan-db: + image: postgres:16.0 + healthcheck: + test: [ "CMD", "pg_isready", "-q", "-d", "postgres", "-U", "postgres" ] + timeout: 45s + interval: 10s + retries: 10 + restart: always + environment: + - POSTGRES_USER=${VACHAN_POSTGRES_USER:-postgres} + - POSTGRES_PASSWORD=${VACHAN_POSTGRES_PASSWORD:-password} + - POSTGRES_DB=${VACHAN_POSTGRES_DATABASE:-vachan_dev} + - POSTGRES_HOST_AUTH_METHOD=trust + logging: + options: + max-size: 10m + max-file: "3" + expose: + - 5432 + ports: + # HOST:CONTAINER + - "5433:5432" + networks: + - VE-network + volumes: + # - ${VACHAN_POSTGRES_DATA_DIR:-./pgdata}:/var/lib/postgresql/data + - vachan-db-vol:/var/lib/postgresql/data + # - ../db/csvs:/csvs + # - ../db/seed_DB.sql:/docker-entrypoint-initdb.d/seed_DB.sql + - vachan-db-backup:/var/backups:rw + labels: + ofelia.enabled: "true" + ofelia.job-exec.vachan-backup.schedule: "0 0 0 * * *" #"Takes a single dump within the db container every day at 00:00 am" + ofelia.job-exec.vachan-backup.command: "pg_dump --dbname=postgresql://$VACHAN_POSTGRES_USER:$VACHAN_POSTGRES_PASSWORD@localhost:5432/$VACHAN_POSTGRES_DATABASE --file=/var/backups/vachan_db_backup_latest.sql" + + #vachan-api app + vachan-api: + build: + context: ../ + dockerfile: ./docker/Dockerfile + healthcheck: + timeout: 45s + interval: 10s + retries: 10 + environment: + - VACHAN_POSTGRES_HOST=vachan-db + - VACHAN_POSTGRES_USER=${VACHAN_POSTGRES_USER:-postgres} + - VACHAN_POSTGRES_PASSWORD=${VACHAN_POSTGRES_PASSWORD:-password} + - VACHAN_POSTGRES_DATABASE=${VACHAN_POSTGRES_DATABASE:-vachan_dev} + - VACHAN_POSTGRES_PORT=5432 + - VACHAN_TEST_MODE="False" + - VACHAN_LOGGING_LEVEL=INFO + - VACHAN_GITLAB_TOKEN=${VACHAN_GITLAB_TOKEN:-none} + - VACHAN_REDIS_HOST=redis + - VACHAN_REDIS_PORT=6379 + - VACHAN_REDIS_PASS=${VACHAN_REDIS_PASS:-vsfrgetd} + - VACHAN_DOMAIN=${VACHAN_DOMAIN:-http://localhost:8000} + command: uvicorn main:app --host 0.0.0.0 --port 8000 + volumes: + - logs-vol:/app/logs + restart: always + links: + - vachan-db + expose: + - 8000 + profiles: + - local-run + - deployment + networks: + - VE-network + + vachan-api-test: + build: + context: ../ + dockerfile: ./docker/Dockerfile + healthcheck: + timeout: 45s + interval: 10s + retries: 10 + environment: + - VACHAN_POSTGRES_HOST=vachan-db + - VACHAN_POSTGRES_USER=${VACHAN_POSTGRES_USER:-postgres} + - VACHAN_POSTGRES_PASSWORD=${VACHAN_POSTGRES_PASSWORD:-password} + - VACHAN_POSTGRES_DATABASE=${VACHAN_POSTGRES_DATABASE:-vachan_dev} + - VACHAN_POSTGRES_PORT=5432 + - VACHAN_KRATOS_PUBLIC_URL=http://kratos:4433/ + - VACHAN_KRATOS_ADMIN_URL=http://kratos:4434/ + - VACHAN_SUPER_USERNAME=${VACHAN_SUPER_USERNAME:-super@admin.com} + - VACHAN_GITLAB_TOKEN=${VACHAN_GITLAB_TOKEN} + - VACHAN_SUPER_PASSWORD=${VACHAN_SUPER_PASSWORD:-Just4Complexity!} + - VACHAN_TEST_MODE="False" + - VACHAN_LOGGING_LEVEL=INFO + - VACHAN_DOMAIN=${VACHAN_DOMAIN:-http://localhost:8000} + command: python -m pytest + volumes: + - logs-test-vol:/app/logs + restart: "no" + expose: + - 8000 + links: + - vachan-db + - kratos + depends_on: + - kratos-postgresd + - kratos + - vachan-db + profiles: + - testing + networks: + - VE-network + + vachan-demos: + image: vachanengine/vachan-demos:v2.0.0-alpha.13 + expose: + - 8002 + command: uvicorn main:app --host 0.0.0.0 --port 8002 + restart: always + environment: + - VACHAN_DOMAIN=${VACHAN_DOMAIN:-api.vachanengine.org} + - VACHAN_LOGGING_LEVEL=INFO + volumes: + - logs-vol:/app/logs + depends_on: + - vachan-api + profiles: + - local-run + - deployment + networks: + - VE-network + + vachan-cms-rest: + image: vachanengine/vachan-cms-rest:v2.0.13 + expose: + - 8005 + command: uvicorn main:app --host 0.0.0.0 --port 8005 + restart: always + environment: + - VACHAN_POSTGRES_HOST=vachan-db + - VACHAN_POSTGRES_PORT=5432 + - VACHAN_POSTGRES_USER=${VACHAN_POSTGRES_USER:-postgres} + - VACHAN_POSTGRES_PASSWORD=${VACHAN_POSTGRES_PASSWORD:-password} + - VACHAN_POSTGRES_DATABASE=${VACHAN_POSTGRES_DATABASE:-vachan_dev} + - VACHAN_POSTGRES_SCHEMA=vachan_cms_rest + - VACHAN_LOGGING_LEVEL=INFO + - VACHAN_DOMAIN=http://vachan-access:8007 + - VACHAN_CMS_DOMAIN=http://vachan-api + volumes: + - logs-vol:/app/logs + depends_on: + - vachan-db + profiles: + - local-run + - deployment + networks: + - VE-network + + vachan-tbt: + image: vachanengine/vachan-tbt:v2.0.2 + expose: + - 8003 + command: uvicorn main:app --host 0.0.0.0 --port 8003 + restart: always + environment: + - VACHAN_POSTGRES_HOST=vachan-db + - VACHAN_POSTGRES_PORT=5432 + - VACHAN_POSTGRES_USER=${VACHAN_POSTGRES_USER:-postgres} + - VACHAN_POSTGRES_PASSWORD=${VACHAN_POSTGRES_PASSWORD:-password} + - VACHAN_POSTGRES_DATABASE=${VACHAN_POSTGRES_DATABASE:-vachan_dev} + - VACHAN_POSTGRES_SCHEMA=vachan_tbt + - VACHAN_LOGGING_LEVEL=INFO + - VACHAN_DOMAIN=${VACHAN_DOMAIN:-http://localhost} + - VACHAN_CMS_DOMAIN=http://vachan-api + volumes: + - logs-vol:/app/logs + - vachan-tbt-ml-models-vol:/app/ml-models + depends_on: + - vachan-db + profiles: + - local-run + - deployment + networks: + - VE-network + + vachan-cms-graphql: + image: vachanengine/vachan-cms-graphql:v2.0.1 + ports: + - "8004:8004" + expose: + - 8004 + command: uvicorn main:app --host 0.0.0.0 --port 8004 + restart: always + environment: + - VACHAN_POSTGRES_HOST=vachan-db + - VACHAN_POSTGRES_USER=${VACHAN_POSTGRES_USER:-postgres} + - VACHAN_POSTGRES_PASSWORD=${VACHAN_POSTGRES_PASSWORD:-password} + - VACHAN_POSTGRES_DATABASE=${VACHAN_POSTGRES_DATABASE:-vachan_dev} + - VACHAN_POSTGRES_PORT=5432 + - VACHAN_DOMAIN=${VACHAN_DOMAIN:-api.vachanengine.org} + - VACHAN_LOGGING_LEVEL=INFO + depends_on: + - vachan-api + - vachan-db + profiles: + - local-run + - deployment + networks: + - VE-network + + kratos-app: + depends_on: + - kratos-migrate + image: oryd/kratos:v1.0.0 + ports: + - "4443:4433" # public + - "4444:4434" # admin + expose: + - 4443 + - 4444 + restart: unless-stopped + environment: + - COURIER_SMTP_CONNECTION_URI=${VACHAN_SUPPORT_EMAIL_CREDS:-smtps://test:test@mailslurper:1025/?skip_ssl_verify=true&legacy_ssl=true} + - COURIER_SMTP_FROM_ADDRESS=${VACHAN_SUPPORT_EMAIL:-EMAIL_ADDRESS@bridgeconn.com} + - DSN=${VACHAN_AUTH_DATABASE:-postgres://kratos:secret@kratos-postgresd:5432/kratos?sslmode=disable&max_conns=20&max_idle_conns=4} + - LOG_LEVEL=trace + command: serve -c /etc/config/kratos/kratos-app.yml --watch-courier + volumes: + - type: volume + source: kratos-sqlite + target: /var/lib/sqlite + read_only: false + - type: bind + source: ./Kratos_config/email-password + target: /etc/config/kratos + networks: + - VE-network + + vachan-access: + image: vachanengine/vachan-access:v2.0.10 + environment: + - VACHAN_POSTGRES_HOST=vachan-db + - VACHAN_POSTGRES_USER=${VACHAN_POSTGRES_USER:-postgres} + - VACHAN_POSTGRES_PASSWORD=${VACHAN_POSTGRES_PASSWORD:-password} + - VACHAN_POSTGRES_DATABASE=${VACHAN_POSTGRES_DATABASE:-vachan_dev} + - VACHAN_POSTGRES_PORT=5432 + - VACHAN_KRATOS_PUBLIC_URL=${VACHAN_KRATOS_PUBLIC_URL:-http://kratos:4433/} + - VACHAN_KRATOS_ADMIN_URL=http://kratos:4434/ + - VACHAN_KRATOS_APP_PUBLIC_URL=http://kratos-app:4433/ + - VACHAN_KRATOS_APP_ADMIN_URL=http://kratos-app:4434/ + - VACHAN_SUPER_USERNAME=${VACHAN_SUPER_USERNAME} + - VACHAN_SUPER_PASSWORD=${VACHAN_SUPER_PASSWORD} + - VACHAN_TEST_MODE="False" + - VACHAN_LOGGING_LEVEL=INFO + - VACHAN_DOMAIN=${VACHAN_DOMAIN:-http://localhost} + - VACHAN_CMS_DOMAIN=http://vachan-api + command: uvicorn main:app --host 0.0.0.0 --port 8007 + volumes: + - logs-vol:/app/logs + restart: always + links: + - vachan-db + - kratos + - kratos-app + depends_on: + - vachan-db + - kratos + - kratos-app + expose: + - 8007 + profiles: + - local-run + - deployment + networks: + - VE-network + + + vachan-ai: + image: vachanengine/vachan-ai:0.0.0-alpha.11 + healthcheck: + timeout: 45s + interval: 10s + retries: 10 + environment: + - VACHAN_POSTGRES_HOST=${VACHAN_POSTGRES_HOST:-vachan-db} + - VACHAN_POSTGRES_USER=${VACHAN_POSTGRES_USER:-postgres} + - VACHAN_POSTGRES_PASSWORD=${VACHAN_POSTGRES_PASSWORD:-password} + - VACHAN_POSTGRES_DATABASE=${VACHAN_POSTGRES_DATABASE:-vachan_dev} + - VACHAN_POSTGRES_SCHEMA=${VACHAN_POSTGRES_SCHEMA:-aischema} + - VACHAN_POSTGRES_PORT=5432 + + - VACHAN_AI_XLSR_MAX_AUDIO_DURATION=${VACHAN_AI_XLSR_MAX_AUDIO_DURATION:-25} + - VACHAN_AI_XLSR_SAMPLING_RATE=${VACHAN_AI_XLSR_SAMPLING_RATE:-16000} + - VACHAN_AI_NLLB_MAX_SRC_CHARS=${VACHAN_AI_NLLB_MAX_SRC_CHARS:-512} + - VACHAN_AI_NLLB_BATCH_SIZE=${VACHAN_AI_NLLB_BATCH_SIZE:-10} + + + - MLFLOW_TRACKING_URI=${MLFLOW_TRACKING_URI:-http://dov2prodconn.bridgeconn.com:8083} + - VACHAN_AI_ARTIFACT_PATH=${VACHAN_AI_ARTIFACT_PATH:-models} + - VACHAN_AI_SERVED_MODEL_URI=${VACHAN_AI_SERVED_MODEL_URI:-http://dov2prodconn.bridgeconn.com:8085/v2/models} + - VACHAN_AI_MODEL_SETTINGS_DIR=${VACHAN_AI_MODEL_SETTINGS_DIR:-serving_model} + - VACHAN_AI_REQUEST_TIMEOUT=${VACHAN_AI_REQUEST_TIMEOUT:-60} + + - VACHAN_AI_AWS_ACCESS_KEY=${VACHAN_AI_AWS_ACCESS_KEY} + - VACHAN_AI_AWS_SECRET_ACCESS_KEY=${VACHAN_AI_AWS_SECRET_ACCESS_KEY} + - VACHAN_AI_S3_BUCKET=${VACHAN_AI_S3_BUCKET} + - VACHAN_AI_AWS_ACCOUNT_REGION=${VACHAN_AI_AWS_ACCOUNT_REGION} + + + - VACHAN_AI_DATA_PATH=${VACHAN_AI_DATA_PATH:-/home/gitautodeploy/vachan_ai_data} + - VACHAN_AI_LOGGING_LEVEL=INFO + - VACHAN_LOGGING_LEVEL=INFO + - VACHAN_AI_ENV=${VACHAN_AI_ENV:-Production} + - VACHAN_AI_MLSERVER_REQUEST_TIMEOUT=120 + - PYTHONPATH=/app/app/core/model_access/ai_model_core.py:/app/app/core/cloud_operations + - VACHAN_REDIS_PASS=${VACHAN_REDIS_PASS:-vsfrgetd} + - VACHAN_AI_DELETION_PERIOD=${VACHAN_AI_DELETION_PERIOD:-14} + - VACHAN_AI_CRON_DAY=${VACHAN_AI_CRON_DAY:-MON} + - VACHAN_AI_CRON_HOUR=${VACHAN_AI_CRON_HOUR:-12} + - VACHAN_AI_CRON_MINUTE=${VACHAN_AI_CRON_MINUTE:-30} + - VACHAN_AI_BASEPATH=/v2/ai + - VACHAN_DOMAIN=${VACHAN_DOMAIN:-http://vachan-access:8007} + - VACHAN_AI_DOMAIN=http://vachan-api + command: uvicorn main:app --host 0.0.0.0 --port 8009 + volumes: + - ${VACHAN_AI_DATA_PATH:-/home/gitautodeploy/vachan_ai_data}/docker-volumes/ai-logs-vol:/app/logs + - ${VACHAN_AI_DATA_PATH:-/home/gitautodeploy/vachan_ai_data}/cache:/root/.cache + - ${VACHAN_AI_DATA_PATH:-/home/gitautodeploy/vachan_ai_data}/Downloads:/tmp + - ${VACHAN_AI_DATA_PATH}/Downloads:${VACHAN_AI_DATA_PATH}/Downloads + restart: always + links: + - redis + - vachan-db + depends_on: + - vachan-db + - vachan-api + - redis + profiles: + - local-run + - deployment + expose: + - 8009 + ports: + - "8009:8009" + networks: + - VE-network + container_name: vachan-ai + + + worker: + image: vachanengine/vachan-ai:0.0.0-alpha.11 + healthcheck: + timeout: 45s + interval: 10s + retries: 10 + environment: + - REDIS_HOST=redis + - REDIS_PORT=6379 + - VACHAN_POSTGRES_HOST=${VACHAN_POSTGRES_HOST:-vachan-db} + - VACHAN_POSTGRES_USER=${VACHAN_POSTGRES_USER:-postgres} + - VACHAN_POSTGRES_PASSWORD=${VACHAN_POSTGRES_PASSWORD:-password} + - VACHAN_POSTGRES_DATABASE=${VACHAN_POSTGRES_DATABASE:-vachan_dev} + - VACHAN_POSTGRES_SCHEMA=${VACHAN_POSTGRES_SCHEMA:-aischema} + - VACHAN_POSTGRES_PORT=5432 + - VACHAN_AI_DATA_PATH=${VACHAN_AI_DATA_PATH:-/home/gitautodeploy/vachan_ai_data} + - VACHAN_AI_SERVED_MODEL_URI=${VACHAN_AI_SERVED_MODEL_URI:-http://dov2prodconn.bridgeconn.com:8085/v2/models} + - VACHAN_AI_MLSERVER_REQUEST_TIMEOUT=120 + - PYTHONPATH=/app/app/core/model_access/ai_model_core.py:/app/app/core/cloud_operations + command: rq worker --url redis://:${VACHAN_REDIS_PASS}@redis:6379 + links: + - redis + - vachan-db + depends_on: + - vachan-db + - redis + - vachan-api + volumes: + - ${VACHAN_AI_DATA_PATH:-/home/gitautodeploy/vachan_ai_data}/docker-volumes/redis_worker-logs-vol:/app/rqlogs + - ../data/csvs:/csvs + - ${VACHAN_AI_DATA_PATH:-/home/gitautodeploy/vachan_ai_data}/Downloads:/tmp + profiles: + - local-run + - deployment + networks: + - VE-network + container_name: redis-worker + + + # Web Server + web-server-local: + image: nginx:latest + ports: + - 80:80 + restart: always + expose: + - 80 + depends_on: + - vachan-api + volumes: + - ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro + - logs-vol:/var/log/nginx/ + profiles: + - local-run + networks: + - VE-network + + web-server-with-cert: + image: nginx:latest + ports: + - 80:80 + - 443:443 + restart: always + expose: + - 80 + - 443 + depends_on: + - vachan-api + volumes: + - ./nginx/prod/app.conf.template:/etc/nginx/templates/default.conf.template:ro + - ./certbot/www:/var/www/certbot/:ro + - ./certbot/conf/:/etc/nginx/ssl/:ro + - logs-vol:/var/log/nginx/ + environment: + - VACHAN_DOMAIN=${VACHAN_DOMAIN} + profiles: + - deployment + networks: + - VE-network + + certbot: + image: certbot/certbot:latest + volumes: + - ./certbot/www/:/var/www/certbot/:rw + - ./certbot/conf/:/etc/letsencrypt/:rw + profiles: + - deployment + networks: + - VE-network + + + ofelia-scheduler: + image: mcuadros/ofelia:v0.3.7 + depends_on: + - kratos-postgresd + - vachan-db + command: daemon --docker + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + - kratos-db-backup:/var/backups/kratos:ro + - vachan-db-backup:/var/backups/vachan:ro + - /mnt/vachanapi_backup:/var/backup-copies/:rw + - logs-vol:/app/logs + environment: + - TZ=${TIMEZONE:-Asia/Calcutta} + labels: + ofelia.job-local.copy-vachan-backup-daily.schedule: "0 0 3 * * *" # Copies latest dump from DB container every day at 03:00 am + ofelia.job-local.copy-vachan-backup-daily.command: sh -c "cp /var/backups/vachan/vachan_db_backup_latest.sql /var/backup-copies/vachan_db_backup_daily_`date +%Y-%m-%d_%H_%M_%S`.sql && echo `date`':Daily backup successful(vachan-db)' >> /app/logs/backup.log || echo `date`':Daily backup failed(vachan)' >> /app/logs/backup.log" + ofelia.job-local.prune-vachan-daily-backup.schedule: "0 0 0 * * *" # Retains only latest 7 of the daily backups + ofelia.job-local.prune-vachan-daily-backup.command: sh -c "ls -tr /var/backup-copies/vachan_db_backup_daily* | head -n -7 | xargs rm -f -- && echo `date`':Daily Prune successful(vachan-db)' >> /app/logs/backup.log || echo `date`':Daily Prune failed(vachan)' >> /app/logs/backup.log" + ofelia.job-local.copy-vachan-backup-weekly.schedule: "0 0 3 ? * SUN" # Copies latest dump on every sunday 03:00 am + ofelia.job-local.copy-vachan-backup-weekly.command: sh -c "cp /var/backups/vachan/vachan_db_backup_latest.sql /var/backup-copies/vachan_db_backup_weekly_`date +%Y-%m-%d_%H_%M_%S`.sql && echo `date`':Weekly backup successful(vachan-db)' >> /app/logs/backup.log || echo `date`':Weekly backup failed(vachan)' >> /app/logs/backup.log" + ofelia.job-local.prune-vachan-weekly-backup.schedule: "0 0 0 ? * SUN" # Retains only latest 4 of the weekly backups + ofelia.job-local.prune-vachan-weekly-backup.command: sh -c "ls -tr /var/backup-copies/vachan_db_backup_weekly* | head -n -4 | xargs rm -f -- && echo `date`':Weekly Prune successful(vachan-db)' >> /app/logs/backup.log || echo `date`':Weekly Prune failed(vachan)' >> /app/logs/backup.log" + ofelia.job-local.copy-vachan-backup-monthly.schedule: "0 0 3 1 * *" # Copies latest dump on first day of every month + ofelia.job-local.copy-vachan-backup-monthly.command: sh -c "cp /var/backups/vachan/vachan_db_backup_latest.sql /var/backup-copies/vachan_db_backup_monthly_`date +%Y-%m-%d_%H_%M_%S`.sql && echo `date`':Monthly backup successful(vachan-db)' >> /app/logs/backup.log || echo `date`':Monthly backup failed(vachan)' >> /app/logs/backup.log" + ofelia.job-local.prune-vachan-monthly-backup.schedule: "0 0 0 1 * *" # Retains only latest 12 of the montly dumps + ofelia.job-local.prune-vachan-monthly-backup.command: sh -c "ls -tr /var/backup-copies/vachan_db_backup_monthly* | head -n -12 | xargs rm -f -- && echo `date`':Monthly Prune successful(vachan-db)' >> /app/logs/backup.log || echo `date`':Monthly Prune failed(vachan)' >> /app/logs/backup.log" + ofelia.job-local.copy-vachan-backup-yearly.schedule: "0 0 4 1 JAN *" # Copies latest dump on first day of every year + ofelia.job-local.copy-vachan-backup-yearly.command: sh -c "cp /var/backups/vachan/vachan_db_backup_latest.sql /var/backup-copies/vachan_db_backup_yearly_`date +%Y-%m-%d_%H_%M_%S`.sql && echo `date`':Yearly backup successful(vachan-db)' >> /app/logs/backup.log || echo `date`':Yearly backup failed(vachan)' >> /app/logs/backup.log" + ofelia.job-local.copy-kratos-backup-daily.schedule: "0 0 4 * * *" # Copies latest dump from DB container every day at 04:00 am + ofelia.job-local.copy-kratos-backup-daily.command: sh -c "cp /var/backups/kratos/kratos_db_backup_latest.sql /var/backup-copies/kratos_db_backup_daily_`date +%Y-%m-%d_%H_%M_%S`.sql && echo `date`':Daily backup successful(kratos)' >> /app/logs/backup.log || echo `date`':Daily backup failed(kratos)' >> /app/logs/backup.log" + ofelia.job-local.prune-kratos-daily-backup.schedule: "0 0 1 * * *" # Retains only latest 7 of the daily backups + ofelia.job-local.prune-kratos-daily-backup.command: sh -c "ls -tr /var/backup-copies/kratos_db_backup_daily* | head -n -7 | xargs rm -f -- && echo `date`':Daily Prune successful(kratos)' >> /app/logs/backup.log || echo `date`':Daily Prune failed(kratos)' >> /app/logs/backup.log" + ofelia.job-local.copy-kratos-backup-weekly.schedule: "0 0 4 ? * SUN" # Copies latest dump on every sunday 04:00 am + ofelia.job-local.copy-kratos-backup-weekly.command: sh -c "cp /var/backups/kratos/kratos_db_backup_latest.sql /var/backup-copies/kratos_db_backup_weekly_`date +%Y-%m-%d_%H_%M_%S`.sql && echo `date`':Weekly backup successful(kratos)' >> /app/logs/backup.log || echo `date`':Weekly backup failed(kratos)' >> /app/logs/backup.log" + ofelia.job-local.prune-kratos-weekly-backup.schedule: "0 1 0 ? * SUN" # Retains only latest 4 of the weekly backups + ofelia.job-local.prune-kratos-weekly-backup.command: sh -c "ls -tr /var/backup-copies/kratos_db_backup_weekly* | head -n -4 | xargs rm -f -- && echo `date`':Weekly Prune successful(kratos)' >> /app/logs/backup.log || echo `date`':Weekly Prune failed(kratos)' >> /app/logs/backup.log" + ofelia.job-local.copy-kratos-backup-monthly.schedule: "0 0 4 1 * *" # Copies latest dump on first day of every month + ofelia.job-local.copy-kratos-backup-monthly.command: sh -c "cp /var/backups/kratos/kratos_db_backup_latest.sql /var/backup-copies/kratos_db_backup_monthly_`date +%Y-%m-%d_%H_%M_%S`.sql && echo `date`':Monthly backup successful(kratos)' >> /app/logs/backup.log || echo `date`':Monthly backup failed(kratos)' >> /app/logs/backup.log" + ofelia.job-local.prune-kratos-monthly-backup.schedule: "0 0 1 1 * *" # Retains only latest 12 of the montly dumps + ofelia.job-local.prune-kratos-monthly-backup.command: sh -c "ls -tr /var/backup-copies/kratos_db_backup_monthly* | head -n -12 | xargs rm -f -- && echo `date`':Monthly Prune successful(kratos)' >> /app/logs/backup.log || echo `date`':Monthly Prune failed(kratos)' >> /app/logs/backup.log" + ofelia.job-local.copy-kratos-backup-yearly.schedule: "0 0 4 1 JAN *" # Copies latest dump on first day of every year + ofelia.job-local.copy-kratos-backup-yearly.command: sh -c "cp /var/backups/kratos/kratos_db_backup_latest.sql /var/backup-copies/kratos_db_backup_yearly_`date +%Y-%m-%d_%H_%M_%S`.sql && echo `date`':Yearly backup successful(kratos)' >> /app/logs/backup.log || echo `date`':Yearly backup failed(kratos)' >> /app/logs/backup.log" + networks: + - VE-network + + + #redis caching DB + redis: + container_name: redis + image: "redis:alpine" + expose: + - 6379 + volumes: + # save redisearch data to your current working directory + - redis-data:/app/data + # - ./redis_config/redis.conf:/usr/local/etc/redis/redis.conf + command: redis-server --requirepass ${VACHAN_REDIS_PASS:-vsfrgetd} + # command: redis-server --bind 172.28.1.4 + # command: redis-server /usr/local/etc/redis/redis.conf + restart: on-failure + # links: + # - vachan-api + networks: + - VE-network + + # redis db visualization dashboard + redisinsight: + container_name: redisinsight + image: redislabs/redisinsight:latest + ports: + - '8001:8001' + volumes: + # - ./redisinsight:/db + - redisinsight:/app/db + profiles: + - local-run + networks: + - VE-network + +networks: + VE-network: + +volumes: + vachan-db-vol: + logs-vol: + kratos-sqlite: + redis-data: + redisinsight: + kratos-postgres-vol: + logs-test-vol: + vachan-db-backup: + kratos-db-backup: + vachan-tbt-ml-models-vol: \ No newline at end of file