<commit_before># Follow the instruction below for easy setup of environment
#
# Usage:
# 1. ./docker-build.sh
# 2. sudo pip install -U docker-compose # only the first time
# 3. Add these lines to .bashrc at $HOME of your PC
#    * export OPENCOG_SOURCE_DIR=$HOME/path/to/opencog/
#    * export RELEX_SOURCE_DIR=$HOME/path/to/relex/
# 4. Options for developing opencog
#    * docker-compose run --service-ports dev   # to map container ports to host
#    * docker-compose run dev   # if you don't want to map ports to hosts
# 5. cat /etc/hosts   # take note of the ip address for relex, e.g. 172.17.0.69     relex
# 6. Start opencog and telnet/netcat into the scheme shell
# 7. Configure relex-server-host, e.g. (define relex-server-host "172.17.0.69")
# 8. (nlp-parse "you know what this is.")
#
# Notes:
# * On exiting opencog container, postgres & relex will still be running in the
#   background. So when performing step 4 above it will autolink to them.
# * If you just want to work on relex
#    * docker-compose  run --service-ports relex   # to map container ports to host
#    * docker-compose run relex   # if you don't want to map ports to hosts
# * For more on docker-compose refert to https://docs.docker.com/compose/

dev:
    image: opencog/opencog-dev:cli
    ports: # syntax is host:container
        - "5000:5000"
        - "17001:17001"
        - "18001:18001"
        - "8080:8080"
    working_dir: /opencog # This is the same as the volume mount point above
    volumes:
        - $OPENCOG_SOURCE_DIR:/opencog
    links:
        - postgres:db
        - relex:relex
    environment: # Set environment variables within the container
        - PYTHONPATH=/opencog/build/opencog/cython:/opencog/opencog/python/:/opencog/opencog/nlp/
        - OPENCOG_SOURCE_DIR=/opencog

postgres:
    image: postgres:latest
    volumes: # for persisting data across sessions
        - $PWD/data/:/var/lib/postgresql/data

relex:
    image: opencog/relex
    ports:
        - "4444:4444"
        - "9000:9000"
        - "3333:3333"
    working_dir: /relex
    volumes:
        - $RELEX_SOURCE_DIR:/relex
    command: /bin/sh -c "ant
                        && chmod u+x opencog-server.sh
                        && ./opencog-server.sh"
<commit_msg>share .gitconfig within container for easier workflow<commit_after># Follow the instruction below for easy setup of environment
#
# Usage:
# 1. ./docker-build.sh
# 2. sudo pip install -U docker-compose # only the first time
# 3. Add these lines to .bashrc at $HOME of your PC
#    * export OPENCOG_SOURCE_DIR=$HOME/path/to/opencog/
#    * export RELEX_SOURCE_DIR=$HOME/path/to/relex/
# 4. Options for developing opencog
#    * docker-compose run --service-ports dev   # to map container ports to host
#    * docker-compose run dev   # if you don't want to map ports to hosts
# 5. cat /etc/hosts   # take note of the ip address for relex, e.g. 172.17.0.69     relex
# 6. Start opencog and telnet/netcat into the scheme shell
# 7. Configure relex-server-host, e.g. (define relex-server-host "172.17.0.69")
# 8. (nlp-parse "you know what this is.")
#
# Notes:
# * On exiting opencog container, postgres & relex will still be running in the
#   background. So when performing step 4 above it will autolink to them.
# * If you just want to work on relex
#    * docker-compose  run --service-ports relex   # to map container ports to host
#    * docker-compose run relex   # if you don't want to map ports to hosts
# * For more on docker-compose refert to https://docs.docker.com/compose/

dev:
    image: opencog/opencog-dev:cli
    ports: # syntax is host:container
        - "5000:5000"
        - "17001:17001"
        - "18001:18001"
        - "8080:8080"
    working_dir: /opencog # This is the same as the volume mount point above
    volumes:
        - $OPENCOG_SOURCE_DIR:/opencog
        - $HOME/.gitconfig:/home/opencog/.gitconfig
    links:
        - postgres:db
        - relex:relex
    environment: # Set environment variables within the container
        - PYTHONPATH=/opencog/build/opencog/cython:/opencog/opencog/python/:/opencog/opencog/nlp/
        - OPENCOG_SOURCE_DIR=/opencog

postgres:
    image: postgres:latest
    volumes: # for persisting data across sessions
        - $PWD/data/:/var/lib/postgresql/data

relex:
    image: opencog/relex
    ports:
        - "4444:4444"
        - "9000:9000"
        - "3333:3333"
    working_dir: /relex
    volumes:
        - $RELEX_SOURCE_DIR:/relex
    command: /bin/sh -c "ant clean && ant  && ./opencog-server.sh"

{'fraction_non_alphanumeric': 0.10585635359116022, 'fraction_numerical': 0.03756906077348066, 'mean_word_length': 2.5609756097560976, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '2457597', 'n_tokens_mistral': 1673, 'n_tokens_neox': 1514, 'n_words': 466}