Skip to content

Commit

Permalink
Move preloading.
Browse files Browse the repository at this point in the history
  • Loading branch information
scossu committed Oct 22, 2024
1 parent 3e35029 commit 67a359f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ COPY tests ./tests/
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

ENV HF_DATASETS_CACHE /data/hf/datasets
RUN ./sscli admin init-db

RUN chmod +x ./entrypoint.sh
#RUN chown -R www:www ${WORKROOT} .

Expand Down
8 changes: 3 additions & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,12 @@ else
export FLASK_ENV="production"
fi

host=${TXL_WEBAPP_HOST:-"0.0.0.0"}
port=${TXL_WEBAPP_PORT:-"8000"}

./sscli admin init-db

# Preload Thai model.
python -c 'from esupar import load; load("th")'

host=${TXL_WEBAPP_HOST:-"0.0.0.0"}
port=${TXL_WEBAPP_PORT:-"8000"}

if [ "${FLASK_ENV}" == "development" ]; then
exec flask run -h $host -p $port
else
Expand Down
2 changes: 2 additions & 0 deletions scriptshifter_base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ RUN addgroup --system www
RUN adduser --system www
RUN gpasswd -a www www

ENV HF_DATASETS_CACHE /data/hf/datasets

# Copy external dependencies.
WORKDIR ${WORKROOT}
COPY ext ./ext/
Expand Down

0 comments on commit 67a359f

Please sign in to comment.