diff --git a/Dockerfile b/Dockerfile index ffb812d6b..f4953de84 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM alpine:3.8 ENV BUILD_PACKAGES postgresql-dev graphviz-dev graphviz build-base git pkgconfig \ python3-dev libxml2-dev jpeg-dev libressl-dev libffi-dev libxslt-dev \ nodejs npm py3-lxml py3-magic postgresql-client poppler-utils antiword \ - curl jq openssh-client vim openssh-client + curl jq openssh-client vim openssh-client bash RUN apk update --update-cache && apk upgrade diff --git a/start.sh b/start.sh index c3049adc3..cdb3b6868 100755 --- a/start.sh +++ b/start.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash create_env() { echo "[ENV FILE] creating .env file..." @@ -48,17 +48,32 @@ create_env #python3 manage.py bower install -/bin/sh busy-wait.sh $DATABASE_URL +/bin/bash busy-wait.sh $DATABASE_URL ## SOLR +USE_SOLR="${USE_SOLR:=False}" +SOLR_URL="${SOLR_URL:='http://saplsolr:8983'}" +SOLR_COLLECTION="${SOLR_COLLECTION:='sapl_$RANDOM'}" NUM_SHARDS=${NUM_SHARDS:=1} RF=${RF:=1} MAX_SHARDS_PER_NODE=${MAX_SHARDS_PER_NODE:=1} if [ "${USE_SOLR-False}" == "True" ]; then + + echo "SOLR configurations" + echo "===================" + echo "URL: $SOLR_URL" + echo "COLLECTION: $SOLR_COLLECTION" + echo "NUM_SHARDS: $NUM_SHARDS" + echo "REPLICATION FACTOR: $RF" + echo "MAX SHARDS PER NODE: $MAX_SHARDS_PER_NODE" + echo "=========================================" + python3 solr_api.py -u $SOLR_URL -c $SOLR_COLLECTION -s $NUM_SHARDS -rf $RF -ms $MAX_SHARDS_PER_NODE & # python3 manage.py rebuild_index --noinput & +else + echo "Suporte a SOLR não inicializado." fi # manage.py migrate --noinput nao funcionava