azdata/HF_SQLite
0
1FROM python:3.11-slim2 3ENV PYTHONUNBUFFERED=1 PYTHONDONTWRITEBYTECODE=1 DEBIAN_FRONTEND=noninteractive4 5RUN apt-get update && apt-get install -y --no-install-recommends \6 unzip curl ca-certificates tzdata \7 && ln -fs /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime \8 && dpkg-reconfigure -f noninteractive tzdata \9 && rm -rf /var/lib/apt/lists/*10 11ENV TZ=Asia/Ho_Chi_Minh12 13RUN useradd -m -u 1000 user14USER user15ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH16WORKDIR $HOME/app17 18RUN pip install --no-cache-dir \19 fastapi \20 "uvicorn[standard]" \21 pydantic \22 requests \23 "huggingface_hub>=1.26.0,<2" \24 google-api-python-client \25 google-auth \26 google-auth-httplib2 \27 google-auth-oauthlib \28 python-multipart29 30RUN printf '#!/bin/bash\n\31set -e\n\32if [ -f "app.zip" ]; then\n\33 echo "--- decrypting app.zip ---"\n\34 if [ -z "$ZIP_PASSWORD" ]; then\n\35 echo "ERROR: missing HF Space Secret ZIP_PASSWORD"\n\36 exit 1\n\37 fi\n\38 unzip -P "$ZIP_PASSWORD" -o app.zip\n\39 rm app.zip\n\40else\n\41 echo "ERROR: app.zip not found"\n\42 exit 1\n\43fi\n\44exec "$@"\n' > entrypoint.sh && chmod +x entrypoint.sh45 46COPY --chown=user app.zip .47 48EXPOSE 786049 50ENTRYPOINT ["./entrypoint.sh"]51CMD ["uvicorn", "hf_sqlite_app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1", "--no-access-log"]52 