Youngmeen/language-learning-analytics
0
1FROM python:3.12-slim2 3WORKDIR /code4 5RUN pip install --no-cache-dir \6 "fastapi>=0.115" "uvicorn[standard]>=0.32" "httpx>=0.27" \7 "spacy>=3.8,<3.9" "wordfreq>=3.1" "truststore>=0.10"8 9# All six language models baked into the image (spaCy small models, SPEC section 7)10RUN pip install --no-cache-dir \11 https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl \12 https://github.com/explosion/spacy-models/releases/download/ko_core_news_sm-3.8.0/ko_core_news_sm-3.8.0-py3-none-any.whl \13 https://github.com/explosion/spacy-models/releases/download/ja_core_news_sm-3.8.0/ja_core_news_sm-3.8.0-py3-none-any.whl \14 https://github.com/explosion/spacy-models/releases/download/zh_core_web_sm-3.8.0/zh_core_web_sm-3.8.0-py3-none-any.whl \15 https://github.com/explosion/spacy-models/releases/download/fr_core_news_sm-3.8.0/fr_core_news_sm-3.8.0-py3-none-any.whl \16 https://github.com/explosion/spacy-models/releases/download/de_core_news_sm-3.8.0/de_core_news_sm-3.8.0-py3-none-any.whl17 18COPY app ./app19 20# Hugging Face Spaces runs containers as a non-root user21RUN useradd -m appuser22USER appuser23ENV HOME=/home/appuser24 25EXPOSE 786026CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]27 