version: "3"


services:

  alfadoc:
    image: "alfadoc:latest"
    restart: "always"
    container_name: "alfadoc_alfadoc"
    hostname: "alfadoc"
#    extra_hosts:
#      - "id.npc-ksb.ru:109.238.88.229"
#      - "mail.npc-ksb.ru:109.238.88.229"
#      - "online-consult.npc-ksb.ru:109.238.90.96"
#      - "sentry.npc-ksb.ru:109.238.88.229"
    environment:
#      - "CHUNKED_UPLOAD_MAX_BYTES=1073741824"
#      - "BACKUPS_TIME=0 0 31 2 0"
#      - "BACKUPS_CUSTOM=ls -At /opt/alfadoc/var/backups | tail -n +2 | xargs rm -rf --"
#      - "IMPORT_DATA=false"
      - "NO_PROXY=wordtools,postman,audit,alfadoc"
#      - "HTTP_PROXY=prot://user:pass@url:port"
#      - "HTTPS_PROXY=prot://user:pass@url:port"
      - "DJANGO_SETTINGS_MODULE=alfadoc.settings.env_settings_alfak"
      - "SHARED_LOCATION=/opt/alfadoc/var/storage"
      - "VAR_DIR=/opt/alfadoc/var/"
      - "REDIS_HOST=127.0.0.1"
      - "REDIS_PORT=6379"
      - "DATABASE_NAME=alfadoc"
      - "DATABASE_USER=alfadoc"
      - "DATABASE_PASSWORD=vfw4psX1ubxJydWu"
      - "DATABASE_HOST=127.0.0.1"
      - "WORD_TOOLS_SERVICE_URL=http://wordtools:10000/wordtools"
      - "MORPHER_SERVICE=http://wordtools:10000/morpher/morph/"
      - "KNOWLEDGE_API=https://alfa-doc.ru/help/api/"
      - "KNOWLEDGE_AUTH_TOKEN=ac1d4e8290497c4de4ab17a524e6e6523765a677"
      - "AUDIT_API=http://audit:80/api/"
      - "AUDIT_AUTH_TOKEN=5db6a9da84467a0fb5f24b0785b6110ecdba4005"
#      - "POSTMAN_API=http://postman:80/api/"
#      - "POSTMAN_AUTH_TOKEN=6e2da2d1ca45fe467e0ee6b3c575f6240b56ec51"
      - "POSTMAN_API=https://mail.npc-ksb.ru/api/"
      - "POSTMAN_AUTH_TOKEN=e99a04183a1bd888ebe7e63af37f447f1fe14b06"
      - "INSTANCE_NAME=АльфаДок: Краснодарский край: АО «Международный аэропорт «Краснодар»"
      - "EXTERNAL_URL=http://127.0.0.1:8000"
      - "HOST_NAME=127.0.0.1"
#      - "RAVEN_CONFIG="
      - "SENTRY_DSN=https://4d1bad725a1bd9db31a7f041cea4d3e1@sentry.npc-ksb.ru/2528"
      - "SECRET_KEY=9wk7trxpfqhm43!jzr8es9t4rlfchzvbn1tccuo1xj05rss2zk"
      - "ONLINE_CONSULT_SERVICE_ROOT_URL=https://online-consult.npc-ksb.ru"
      - "ONLINE_CONSULT_SERVICE_TOKEN=52810d99-722a-4bf1-9137-f927b7cce7cc"
#      - "ENABLE_MASH=True"
#      - "RABBITMQ_URL=https://alfadoc_2304:6E2kFCktbSK4fyAy@sync.npc-ksb.ru:45453"
      - "APPLICATION_CODE_NAME=alfadoc"
      - "PLATFORM_CODENAME=2304"
      - "LOCAL_ACCOUNT=True"
#      - "OIDC_AUTH_ENDPOINT=https://id.npc-ksb.ru/connect"
#      - "OIDC_CLIENT_ID=K57IqgKa"
#      - "OIDC_CLIENT_SECRET=8249dc4b8e96415abb117a5c2921adb3"
    volumes:
      - "./alfadoc/var:/opt/alfadoc/var:Z"
      - "./alfadoc/log:/var/log:Z"
#      - "/etc/localtime:/etc/localtime:Z"
    ports:
      - "8000:80"
    networks:
      - "alfa"
      - "alfadoc"
    stop_grace_period: 30s
    depends_on:
      - "audit"
      - "wordtools"
      - "postman"

  audit:
    image: "audit:latest"
    restart: "always"
    container_name: "alfadoc_audit"
    hostname: "audit"
#    extra_hosts:
#      - "sentry.npc-ksb.ru:109.238.88.229"
    environment:
      - "NO_PROXY=wordtools,postman,audit,alfadoc"
      - "DJANGO_SETTINGS_MODULE=settings.env"
      - "HOST_NAME=http://localhost:8026/"
      - "EXTERNAL_URL=http://localhost:8026/"
      - "VAR_DIR=/opt/audit/var/"
      - "SHARED_LOCATION=/opt/audit/var/media/"
      - "MEDIA_ROOT=/opt/audit/var/media/"
      - "DATABASE_USER=ksb"
      - "DATABASE_PASSWORD=Lp40pYFFwa9TI5NN"
      - "DATABASE_NAME=audit"
      - "DATABASE_HOST=localhost"
      - "REDIS_HOST=127.0.0.1"
      - "REDIS_PORT=6379"
      - "MORPHER_SERVICE=http://localhost:8080/morpher/morph/"
      - "WEB_CONCURRENCY=5"
#      - "RAVEN_CONFIG="
      - "SENTRY_DSN=https://bf323c2205d643d69ebe5e9b1c625c7e@sentry.npc-ksb.ru/2529"
    volumes:
        - "./audit/var:/opt/audit/var:Z"
        - "./audit/log:/var/log:Z"
#    ports:
#        - "8001:80"
    networks:
      - "alfadoc"
    depends_on:
      - "postman"

  postman:
    image: "postman:latest"
    restart: "always"
#    extra_hosts:
#      - "sentry.npc-ksb.ru:109.238.88.229"
#      - "dns.имя.smtp.сервера:ip.smtp.сервера"
    environment:
      - "NO_PROXY=wordtools,postman,audit,alfadoc"
      - "DJANGO_SETTINGS_MODULE=settings.env"
      - "MEDIA_ROOT=/opt/postman/var/media/"
      - "VAR_DIR=/opt/postman/var/"
      - "DATABASE_HOST=localhost"
      - "DATABASE_NAME=postman"
      - "DATABASE_USER=alfadoc"
      - "DATABASE_PASSWORD=v5EKWi4o1DPKQvqb"
      - "REDIS_HOST=127.0.0.1"
      - "REDIS_PORT=6379"
      - "WEB_CONCURRENCY=5"
      - "EXTERNAL_URL=http://127.0.0.1:8025/"
      - "HOST_NAME=http://127.0.0.1:8025/"
#      - "RAVEN_CONFIG="
      - "SENTRY_DSN=https://f537b324ee75306d3f2ce173e2a24de7@sentry.npc-ksb.ru/2530"
#      - "APPLICATION_EMAIL="
#      - "EMAIL_HOST="
#      - "EMAIL_USER=None"
#      - "EMAIL_PASSWORD=None"
#      - "EMAIL_PORT=25"
#      - "EMAIL_USE_TLS=False"
#      - "EMAIL_USE_SSL=False"
#      - "HTTP_PROXY=http://username:password@proxy_url:proxy_port"
#      - "HTTPS_PROXY=http://username:password@proxy_url:proxy_port"
    container_name: "alfadoc_postman"
    hostname: "postman"
    volumes:
        - "./postman/var:/opt/postman/var:Z"
        - "./postman/log:/var/log:Z"
#    ports:
#        - "8002:80"
    networks:
      - "alfadoc"

  wordtools:
    image: "wordtoolsnet:latest"
    restart: "always"
    container_name: "alfadoc_wordtools"
    hostname: "wordtools"
#    extra_hosts:
#      - "sentry.npc-ksb.ru:109.238.88.229"
    environment:
      - "RAVEN_CONFIG=https://e5df7c30bd5805497e89e513d9f34b6d:1ec35c5027612db661f2a717ee0977c5@sentry.npc-ksb.ru/2531"
      - "NO_PROXY=wordtools,postman,audit,alfadoc"
#    volumes:
#      - "/etc/localtime:/etc/localtime:Z"
#    ports:
#      - "10000:10000"
    networks:
      - "alfadoc"


networks:
  alfa:
    external: true
  alfadoc:
