<commit_before><commit_msg>Added a startup script that configures the container for production or in-container debugging use.<commit_after>#!/bin/bash

debug=false
iface=${IFACE}
port=${PORT}
admin_port=${ADMIN_PORT}

function help {
    echo "Starts the jobber services inside the container, optionally enabling"
    echo "interactive debugging."
    echo 
    echo "Usage: `basename $0` [-h] [-d] [-i IFACE] [-p PORT] [-a ADMIN_PORT]"
    echo
    echo "Options:"
    printf "\t-h\t\tShow this help message\n"
    printf "\t-d\tStart the services in debug mode.\n"
    printf "\t-i <IFACE>\tInterface to bind the services to (defaults to localhost).\n"
    printf "\t-p <PORT>\tAPI services port (defaults to 5000).\n"
    printf "\t-a <ADMIN_PORT>\tAdmin services port (defaults to 8080).\n"
    if [ -z "$1" ]; then
        exit 1
    else
        exit $1
    fi
}

while getopts hdi:p:a: opt; do
    case $opt in
        a)
            admin_port=$OPTARG
            ;;
        p)
            port=$OPTARG
            ;;
        i)
            iface=$OPTARG
            ;;
        d)
            debug=true
            ;;
        h)
            help
            ;;
        *)
            echo "ERROR: Unknown option ${opt}"
            help 1
            ;;
    esac
done

service rsyslog start

if $debug; then
    # run the services in debug mode
    logger -t 'jobber startup' -p local0.info "jobber services starting in debug mode"
    /usr/local/bin/supervisord -c /etc/supervisord.debug.conf
    echo "Jobber container started in debug mode"
    echo "Use ./debug-api to start the API services interactively (ctrl-c to exit)"
    echo "Use ./debug-admin to start the admin services interactively (ctrl-c to exit)"
else
    # run the services in production mode
    logger -t 'jobber startup' -p local0.info "jobber services starting in production mode"
    /usr/local/bin/supervisord -c /etc/supervisord.conf
fi
/bin/bash
{'fraction_non_alphanumeric': 0.10559006211180125, 'fraction_numerical': 0.007763975155279503, 'mean_word_length': 2.143089430894309, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '2106273', 'n_tokens_mistral': 610, 'n_tokens_neox': 581, 'n_words': 207}