<commit_before>#!/bin/sh

export GATEHOUSE_URL=${GATEHOUSE_URL:-"http://gatehouse:8080"}
export MACHINESHOP_URL=${MACHINESHOP_URL:-"http://machineshop:8080"}

if [[ "$PORTAL_URL" == "" ]]; then
  echo "PORTAL_URL must be defined" 1>&2
  exit 1
fi

cat > /etc/nginx/conf.d/variables.conf <<VARIABLES
set \$portal "$PORTAL_URL";
set \$gatehouse "$GATEHOUSE_URL";
set \$machineshop "$MACHINESHOP_URL";
VARIABLES

nginx -t

exec /usr/sbin/nginx
<commit_msg>Using link env vars to fix Nginx resolver problems<commit_after>#!/bin/sh


export GATEHOUSE_URL=${GATEHOUSE_URL:-$(echo $GATEHOUSE_PORT | sed -e 's/tcp/http/')}
export MACHINESHOP_URL=${MACHINESHOP_URL:-$(echo $MACHINESHOP_PORT | sed -e 's/tcp/http/')}

if [[ "$PORTAL_URL" == "" ]]; then
  echo "PORTAL_URL must be defined" 1>&2
  exit 1
fi

cat > /etc/nginx/conf.d/variables.conf <<VARIABLES
set \$portal "$PORTAL_URL";
set \$gatehouse "$GATEHOUSE_URL";
set \$machineshop "$MACHINESHOP_URL";
VARIABLES

nginx -t

exec /usr/sbin/nginx

{'fraction_non_alphanumeric': 0.16767676767676767, 'fraction_numerical': 0.014141414141414142, 'mean_word_length': 5.117283950617284, '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': '6830076', 'n_tokens_mistral': 437, 'n_tokens_neox': 406, 'n_words': 84}