<commit_before>version: "3.9"

# #####################
# VOLUMES
# #####################

volumes:
  registry:
    driver: local
    # make it common to all projects
    name: registry

# All other volumes are moved on volumes_local.yml and volumes_nfs.yml

# #####################
# NETWORKS
# #####################

networks:
  default:
    name: ${COMPOSE_PROJECT_NAME}_${DEPLOY_ENGINE}_default
    driver_opts:
      com.docker.network.driver.mtu: ${NETWORK_MTU}

# #####################
# SERVICES
# #####################

services:
  backend:
    restart: always
    build:
      context: ${SUBMODULE_DIR}/build-templates/${BACKEND_BUILD_MODE}
      args:
        RAPYDO_VERSION: ${RAPYDO_VERSION}
        CURRENT_UID: ${CURRENT_UID}
        CURRENT_GID: ${CURRENT_GID}
    image: rapydo/${BACKEND_BUILD_MODE}:${RAPYDO_VERSION}
    healthcheck:
      test: ${HEALTHCHECK_BACKEND_CMD}
      interval: ${HEALTHCHECK_INTERVAL}
      timeout: 10s
      retries: 3
      start_period: 5m
    hostname: backend-server
    logging:
      driver: ${DOCKER_LOGGING_DRIVER}
      options: {}
    environment:
      ACTIVATE: ${ACTIVATE_BACKEND}
      APP_MODE: ${APP_MODE}
      BUILD: ${BUILD}
      LOGURU_LEVEL: ${LOG_LEVEL}
      LOG_RETENTION: ${LOG_RETENTION}
      FILE_LOGLEVEL: ${FILE_LOGLEVEL}
      CURRENT_UID: ${CURRENT_UID}
      CURRENT_GID: ${CURRENT_GID}
      CRONTAB_ENABLE: ${CRONTAB_ENABLE}
      GZIP_COMPRESSION_ENABLE: ${GZIP_COMPRESSION_ENABLE}
      GZIP_COMPRESSION_THRESHOLD: ${GZIP_COMPRESSION_THRESHOLD}
      GZIP_COMPRESSION_LEVEL: ${GZIP_COMPRESSION_LEVEL}

      PYTHON_PATH: ${PYTHON_PATH}
      PYTHONUNBUFFERED: 1

      PYTHONMALLOC: ${PYTHONMALLOC}
      PYTHONASYNCIODEBUG: ${PYTHONASYNCIODEBUG}
      PYTHONFAULTHANDLER: ${PYTHONFAULTHANDLER}

      FLASK_APP: ${PYTHON_PATH}/restapi/${PYTHON_MAIN_FILE}.py
      FLASK_ENV: ${FLASK_ENV}
      API_AUTOSTART: ${API_AUTOSTART}
      # used by gunicorn
      APP_MODULE: "restapi.${PYTHON_MAIN_FILE}:app"
      GUNICORN_WORKERS: ${GUNICORN_WORKERS}
      GUNICORN_WORKERS_PER_CORE: ${GUNICORN_WORKERS_PER_CORE}
      GUNICORN_MAX_NUM_WORKERS: ${GUNICORN_MAX_NUM_WORKERS}
      PROJECT_NAME: ${COMPOSE_PROJECT_NAME}
      EXTENDED_PACKAGE: ${EXTENDED_PROJECT}
      APP_SECRETS: ${APP_SECRETS}
      DATA_PATH: ${DATA_PATH}
      DATA_IMPORT_FOLDER: ${DATA_IMPORT_FOLDER}
      DOMAIN: ${PROJECT_DOMAIN}
      BACKEND_URL: "${BACKEND_URL}"
      BACKEND_PREFIX: "${BACKEND_PREFIX}"
      FRONTEND_URL: ${FRONTEND_URL}
      FRONTEND_PREFIX: ${FRONTEND_PREFIX}

      # enable /auth/login and /api/admin/users methods
      MAIN_LOGIN_ENABLE: 1
      # base the user/role mechanism on some database
      AUTH_ENABLE: ${ACTIVATE_AUTH}
      AUTH_SERVICE: ${AUTH_SERVICE}
      AUTH_MIN_PASSWORD_LENGTH: ${AUTH_MIN_PASSWORD_LENGTH}
      AUTH_FORCE_FIRST_PASSWORD_CHANGE: ${AUTH_FORCE_FIRST_PASSWORD_CHANGE}
      AUTH_MAX_PASSWORD_VALIDITY: ${AUTH_MAX_PASSWORD_VALIDITY}
      AUTH_DISABLE_UNUSED_CREDENTIALS_AFTER: ${AUTH_DISABLE_UNUSED_CREDENTIALS_AFTER}
      AUTH_MAX_LOGIN_ATTEMPTS: ${AUTH_MAX_LOGIN_ATTEMPTS}
      AUTH_LOGIN_BAN_TIME: ${AUTH_LOGIN_BAN_TIME}
      AUTH_SECOND_FACTOR_AUTHENTICATION: ${AUTH_SECOND_FACTOR_AUTHENTICATION}
      AUTH_DEFAULT_USERNAME: "${AUTH_DEFAULT_USERNAME}"
      AUTH_DEFAULT_PASSWORD: "${AUTH_<PASSWORD>}"
      AUTH_JWT_TOKEN_TTL: ${AUTH_JWT_TOKEN_TTL}
      AUTH_TOKEN_SAVE_FREQUENCY: ${AUTH_TOKEN_SAVE_FREQUENCY}
      AUTH_TOKEN_IP_GRACE_PERIOD: ${AUTH_TOKEN_IP_GRACE_PERIOD}
      ALLOW_ACCESS_TOKEN_PARAMETER: ${ALLOW_ACCESS_TOKEN_PARAMETER}
      ALLOW_PASSWORD_RESET: ${ALLOW_PASSWORD_RESET}
      ALLOW_REGISTRATION: ${ALLOW_REGISTRATION}
      PROXIED_CONNECTION: ${PROXIED_CONNECTION}
      SSL_FORCE_SELF_SIGNED: ${SSL_FORCE_SELF_SIGNED}

      REGISTRATION_NOTIFICATIONS: ${REGISTRATION_NOTIFICATIONS}
      DEBUG_ENDPOINTS: 0
      FORCE_PRODUCTION_TESTS: ${FORCE_PRODUCTION_TESTS}

      ALCHEMY_ENABLE: ${ACTIVATE_ALCHEMY}
      ALCHEMY_ENABLE_CONNECTOR: ${ALCHEMY_ENABLE_CONNECTOR}
      ALCHEMY_EXPIRATION_TIME: ${ALCHEMY_EXPIRATION_TIME}
      ALCHEMY_VERIFICATION_TIME: ${ALCHEMY_VERIFICATION_TIME}
      ALCHEMY_HOST: ${ALCHEMY_HOST}
      ALCHEMY_PORT: ${ALCHEMY_PORT}
      ALCHEMY_USER: "${ALCHEMY_USER}"
      ALCHEMY_PASSWORD: "${<PASSWORD>}"
      ALCHEMY_DB: ${ALCHEMY_DB}
      ALCHEMY_POOLSIZE: ${ALCHEMY_POOLSIZE}
      ALCHEMY_DBTYPE: ${ALCHEMY_DBTYPE}<commit_msg>Dropped unused DEBUG_ENDPOINTS env variable<commit_after>version: "3.9"

# #####################
# VOLUMES
# #####################

volumes:
  registry:
    driver: local
    # make it common to all projects
    name: registry

# All other volumes are moved on volumes_local.yml and volumes_nfs.yml

# #####################
# NETWORKS
# #####################

networks:
  default:
    name: ${COMPOSE_PROJECT_NAME}_${DEPLOY_ENGINE}_default
    driver_opts:
      com.docker.network.driver.mtu: ${NETWORK_MTU}

# #####################
# SERVICES
# #####################

services:
  backend:
    restart: always
    build:
      context: ${SUBMODULE_DIR}/build-templates/${BACKEND_BUILD_MODE}
      args:
        RAPYDO_VERSION: ${RAPYDO_VERSION}
        CURRENT_UID: ${CURRENT_UID}
        CURRENT_GID: ${CURRENT_GID}
    image: rapydo/${BACKEND_BUILD_MODE}:${RAPYDO_VERSION}
    healthcheck:
      test: ${HEALTHCHECK_BACKEND_CMD}
      interval: ${HEALTHCHECK_INTERVAL}
      timeout: 10s
      retries: 3
      start_period: 5m
    hostname: backend-server
    logging:
      driver: ${DOCKER_LOGGING_DRIVER}
      options: {}
    environment:
      ACTIVATE: ${ACTIVATE_BACKEND}
      APP_MODE: ${APP_MODE}
      BUILD: ${BUILD}
      LOGURU_LEVEL: ${LOG_LEVEL}
      LOG_RETENTION: ${LOG_RETENTION}
      FILE_LOGLEVEL: ${FILE_LOGLEVEL}
      CURRENT_UID: ${CURRENT_UID}
      CURRENT_GID: ${CURRENT_GID}
      CRONTAB_ENABLE: ${CRONTAB_ENABLE}
      GZIP_COMPRESSION_ENABLE: ${GZIP_COMPRESSION_ENABLE}
      GZIP_COMPRESSION_THRESHOLD: ${GZIP_COMPRESSION_THRESHOLD}
      GZIP_COMPRESSION_LEVEL: ${GZIP_COMPRESSION_LEVEL}

      PYTHON_PATH: ${PYTHON_PATH}
      PYTHONUNBUFFERED: 1

      PYTHONMALLOC: ${PYTHONMALLOC}
      PYTHONASYNCIODEBUG: ${PYTHONASYNCIODEBUG}
      PYTHONFAULTHANDLER: ${PYTHONFAULTHANDLER}

      FLASK_APP: ${PYTHON_PATH}/restapi/${PYTHON_MAIN_FILE}.py
      FLASK_ENV: ${FLASK_ENV}
      API_AUTOSTART: ${API_AUTOSTART}
      # used by gunicorn
      APP_MODULE: "restapi.${PYTHON_MAIN_FILE}:app"
      GUNICORN_WORKERS: ${GUNICORN_WORKERS}
      GUNICORN_WORKERS_PER_CORE: ${GUNICORN_WORKERS_PER_CORE}
      GUNICORN_MAX_NUM_WORKERS: ${GUNICORN_MAX_NUM_WORKERS}
      PROJECT_NAME: ${COMPOSE_PROJECT_NAME}
      EXTENDED_PACKAGE: ${EXTENDED_PROJECT}
      APP_SECRETS: ${APP_SECRETS}
      DATA_PATH: ${DATA_PATH}
      DATA_IMPORT_FOLDER: ${DATA_IMPORT_FOLDER}
      DOMAIN: ${PROJECT_DOMAIN}
      BACKEND_URL: "${BACKEND_URL}"
      BACKEND_PREFIX: "${BACKEND_PREFIX}"
      FRONTEND_URL: ${FRONTEND_URL}
      FRONTEND_PREFIX: ${FRONTEND_PREFIX}

      # enable /auth/login and /api/admin/users methods
      MAIN_LOGIN_ENABLE: 1
      # base the user/role mechanism on some database
      AUTH_ENABLE: ${ACTIVATE_AUTH}
      AUTH_SERVICE: ${AUTH_SERVICE}
      AUTH_MIN_PASSWORD_LENGTH: ${AUTH_MIN_PASSWORD_LENGTH}
      AUTH_FORCE_FIRST_PASSWORD_CHANGE: ${AUTH_FORCE_FIRST_PASSWORD_CHANGE}
      AUTH_MAX_PASSWORD_VALIDITY: ${AUTH_MAX_PASSWORD_VALIDITY}
      AUTH_DISABLE_UNUSED_CREDENTIALS_AFTER: ${AUTH_DISABLE_UNUSED_CREDENTIALS_AFTER}
      AUTH_MAX_LOGIN_ATTEMPTS: ${AUTH_MAX_LOGIN_ATTEMPTS}
      AUTH_LOGIN_BAN_TIME: ${AUTH_LOGIN_BAN_TIME}
      AUTH_SECOND_FACTOR_AUTHENTICATION: ${AUTH_SECOND_FACTOR_AUTHENTICATION}
      AUTH_DEFAULT_USERNAME: "${AUTH_DEFAULT_USERNAME}"
      AUTH_DEFAULT_PASSWORD: "${<PASSWORD>}"
      AUTH_JWT_TOKEN_TTL: ${AUTH_JWT_TOKEN_TTL}
      AUTH_TOKEN_SAVE_FREQUENCY: ${AUTH_TOKEN_SAVE_FREQUENCY}
      AUTH_TOKEN_IP_GRACE_PERIOD: ${AUTH_TOKEN_IP_GRACE_PERIOD}
      ALLOW_ACCESS_TOKEN_PARAMETER: ${ALLOW_ACCESS_TOKEN_PARAMETER}
      ALLOW_PASSWORD_RESET: ${ALLOW_PASSWORD_RESET}
      ALLOW_REGISTRATION: ${ALLOW_REGISTRATION}
      PROXIED_CONNECTION: ${PROXIED_CONNECTION}
      SSL_FORCE_SELF_SIGNED: ${SSL_FORCE_SELF_SIGNED}

      REGISTRATION_NOTIFICATIONS: ${REGISTRATION_NOTIFICATIONS}
      FORCE_PRODUCTION_TESTS: ${FORCE_PRODUCTION_TESTS}

      ALCHEMY_ENABLE: ${ACTIVATE_ALCHEMY}
      ALCHEMY_ENABLE_CONNECTOR: ${ALCHEMY_ENABLE_CONNECTOR}
      ALCHEMY_EXPIRATION_TIME: ${ALCHEMY_EXPIRATION_TIME}
      ALCHEMY_VERIFICATION_TIME: ${ALCHEMY_VERIFICATION_TIME}
      ALCHEMY_HOST: ${ALCHEMY_HOST}
      ALCHEMY_PORT: ${ALCHEMY_PORT}
      ALCHEMY_USER: "${ALCHEMY_USER}"
      ALCHEMY_PASSWORD: "${<PASSWORD>}"
      ALCHEMY_DB: ${ALCHEMY_DB}
      ALCHEMY_POOLSIZE: ${ALCHEMY_POOLSIZE}
      ALCHEMY_DBTYPE: ${ALCHEMY_DBTYPE}
{'fraction_non_alphanumeric': 0.11863831712282288, 'fraction_numerical': 0.0019226419362135263, 'mean_word_length': 4.292040694195093, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '637634', 'n_tokens_mistral': 3433, 'n_tokens_neox': 3324, 'n_words': 437}