scossu 7 hónapja
szülő
commit
67a359f20b
3 módosított fájl, 8 hozzáadás és 5 törlés
  1. 3 0
      Dockerfile
  2. 3 5
      entrypoint.sh
  3. 2 0
      scriptshifter_base.Dockerfile

+ 3 - 0
Dockerfile

@@ -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} .
 

+ 3 - 5
entrypoint.sh

@@ -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

+ 2 - 0
scriptshifter_base.Dockerfile

@@ -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/