<commit_before>version: '2'
services:
  nginx:
    image: teanocrata/osclb:0.2.0
    ports:
      - "80:80"
      - "443:443"
    container_name: nginx
    links:
      - oscweb
      - oscapi
      - kibana
      - elastic
      - jupyter
    environment:
      - ALLOWED_IP=${ALLOWED_IP}
      - OPENSMARTCOUNTRY_DOMAIN=opensmartcountry.com
      - KIBANA_OPENSMARTCOUNTRY_DOMAIN=kibana.opensmartcountry.com
      - ELASTIC_OPENSMARTCOUNTRY_DOMAIN=elastic.opensmartcountry.com
      - JUPYTER_OPENSMARTCOUNTRY_DOMAIN=jupyter.opensmartcountry.com
    volumes:
      - ./.htpasswd:/etc/nginx/conf.d/.htpasswd
    volumes_from:
      - letsencrypt
  db:
    image: postgres:9.6.3
    container_name: db
    environment:
      - PGDATA=/var/lib/postgresql/data
    expose:
      - "5432"
    volumes:
      - postgres-db-volume:/var/lib/postgresql/data
  oscapi:
    image: teanocrata/oscapi
    environment:
      - DJANGO_SETTINGS_MODULE=osc.settings.cpd.app_settings
    command: bash -c "python manage.py collectstatic --noinput && gunicorn osc_site.wsgi -b 0.0.0.0:8000"
    volumes:
      - ./Django/secrets.ini:/usr/src/app/tmp/secrets.ini
    expose:
      - "8000"
    links:
      - db
      - elastic
    container_name: oscapi
  oscweb:
    image: teanocrata/oscweb:0.3.0
    volumes:
      - ./secrets.ini:/home/node/OSCWeb/settings/secrets.ini
    expose:
        - "8000"
    links:
      - oscapi
  elastic:
    image: teanocrata/oscelastic:0.1.0
    container_name: elastic
    environment:
      - cluster.name=osc-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms8g -Xmx8g"
      - path.repo=["/usr/share/elasticsearch/backups"]
      - xpack.security.enabled=false
      - xpack.monitoring.enabled=true
      - xpack.watcher.enabled=false
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    mem_limit: 16g
    cap_add:
      - IPC_LOCK
    volumes:
      - es-data:/usr/share/elasticsearch/data
      - es-backup-201707:/usr/share/elasticsearch/backups
    expose:
      - 9300
  kibana:
    image: docker.elastic.co/kibana/kibana:5.2.0
    container_name: kibana
    environment:
      - XPACK_SECURITY_ENABLED=false
    expose:
      - 5601
    links:
      - elastic:elasticsearch
  letsencrypt:
    image: quay.io/letsencrypt/letsencrypt:latest
    command: bash -c "sleep 6 && certbot certonly --standalone -d opensmartcountry.com -d kibana.opensmartcountry.com -d elastic.opensmartcountry.com -d jupyter.opensmartcountry.com --text --agree-tos --email <EMAIL> --server https://acme-v01.api.letsencrypt.org/directory --rsa-key-size 4096 --verbose --renew-by-default --standalone-supported-challenges http-01"
    entrypoint: ""
    volumes:
      - /etc/letsencrypt
      - /var/lib/letsencrypt
    ports:
      - "80"
      - "443"
    environment:
      - TERM=xterm
  jupyter:
    image: jupyter/datascience-notebook
    command: start-notebook.sh
    links:
      - elastic
    volumes:
      - ./jupyter_notebook_config.py:/etc/jupyter/jupyter_notebook_config.py
      - ./jupyter_notebook_config.json:/etc/jupyter/jupyter_notebook_config.json
      - jupyter-work:/home/jovyan

volumes:
  postgres-db-volume:
    external: true
  es-data:
    external: true
  jupyter-work:
    external: true
  es-backup-201707:
    external: true<commit_msg>Revert "Typo"<commit_after>version: '2'
services:
  nginx:
    image: teanocrata/osclb:0.2.0
    ports:
      - "80:80"
      - "443:443"
    container_name: nginx
    links:
      - oscweb
      - oscapi
      - kibana
      - elastic
      - jupyter
    environment:
      - ALLOWED_IP=${ALLOWED_IP}
      - OPENSMARTCOUNTRY_DOMAIN=opensmartcountry.com
      - KIBANA_OPENSMARTCOUNTRY_DOMAIN=kibana.opensmartcountry.com
      - ELASTIC_OPENSMARTCOUNTRY_DOMAIN=elastic.opensmartcountry.com
      - JUPYTER_OPENSMARTCOUNTRY_DOMAIN=jupyter.opensmartcountry.com
    volumes:
      - ./.htpasswd:/etc/nginx/conf.d/.htpasswd
    volumes_from:
      - letsencrypt
  db:
    image: postgres:9.6.3
    container_name: db
    environment:
      - PGDATA=/var/lib/postgresql/data
    expose:
      - "5432"
    volumes:
      - postgres-db-volume:/var/lib/postgresql/data
  oscapi:
    image: teanocrata/oscapi
    environment:
      - DJANGO_SETTINGS_MODULE=osc.settings.cpd.app_settings
    command: bash -c "python manage.py collectstatic --noinput && gunicorn osc_site.wsgi -b 0.0.0.0:8000"
    volumes:
      - ./Django/secrets.ini:/usr/src/app/tmp/secrets.ini
    expose:
      - "8000"
    links:
      - db
      - elastic
    container_name: oscapi
  oscweb:
    image: teanocrata/oscweb:0.3.0
    volumes:
      - ./secrets.ini:/home/node/OSCWeb/settings/secrets.ini
    expose:
        - "8000"
    links:
      - oscapi
  elastic:
    image: teanocrata/oscelastic:0.1.0
    container_name: elastic
    environment:
      - cluster.name=osc-cluster
      - bootstrap.memory_lock=true
      - "ES_JAVA_OPTS=-Xms8g -Xmx8g"
      - path.repo=["/usr/share/elasticsearch/backups"]
      - xpack.security.enabled=false
      - xpack.monitoring.enabled=true
      - xpack.watcher.enabled=false
    ulimits:
      memlock:
        soft: -1
        hard: -1
      nofile:
        soft: 65536
        hard: 65536
    mem_limit: 16g
    cap_add:
      - IPC_LOCK
    volumes:
      - es-data:/usr/share/elasticsearch/data
      - es-backup-201707:/usr/share/elasticsearch/backups
    expose:
      - 9300
  kibana:
    image: docker.elastic.co/kibana/kibana:5.2.0
    container_name: kibana
    environment:
      - XPACK_SECURITY_ENABLED=false
    expose:
      - 5601
    links:
      - elastic:elasticsearch
  letsencrypt:
    image: quay.io/letsencrypt/letsencrypt:latest
    command:  command:  bash -c "sleep 6 && certbot certonly --standalone -d opensmartcountry.com -d kibana.opensmartcountry.com -d elastic.opensmartcountry.com -d jupyter.opensmartcountry.com --text --agree-tos --email <EMAIL> --server https://acme-v01.api.letsencrypt.org/directory --rsa-key-size 4096 --verbose --renew-by-default --standalone-supported-challenges http-01"
    entrypoint: ""
    volumes:
      - /etc/letsencrypt
      - /var/lib/letsencrypt
    ports:
      - "80"
      - "443"
    environment:
      - TERM=xterm
  jupyter:
    image: jupyter/datascience-notebook
    command: start-notebook.sh
    links:
      - elastic
    volumes:
      - ./jupyter_notebook_config.py:/etc/jupyter/jupyter_notebook_config.py
      - ./jupyter_notebook_config.json:/etc/jupyter/jupyter_notebook_config.json
      - jupyter-work:/home/jovyan

volumes:
  postgres-db-volume:
    external: true
  es-data:
    external: true
  jupyter-work:
    external: true
  es-backup-201707:
    external: true
{'fraction_non_alphanumeric': 0.1130589808349428, 'fraction_numerical': 0.028524736294755607, 'mean_word_length': 2.285505124450952, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1829764', 'n_tokens_mistral': 2637, 'n_tokens_neox': 2512, 'n_words': 363}