Spaces:
Runtime error
Runtime error
Deploy reno scheduling engine (FastAPI + Streamlit)
Browse files- Dockerfile +15 -9
Dockerfile
CHANGED
|
@@ -1,18 +1,24 @@
|
|
| 1 |
# Hugging Face Space (Docker SDK). Runs the FastAPI backend + Streamlit UI.
|
|
|
|
|
|
|
| 2 |
FROM python:3.12-slim
|
| 3 |
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
RUN pip install --no-cache-dir -r requirements-space.txt
|
| 8 |
|
| 9 |
-
COPY
|
| 10 |
-
|
| 11 |
-
COPY scripts ./scripts
|
| 12 |
-
COPY streamlit_app.py start.sh ./
|
| 13 |
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
| 16 |
|
| 17 |
EXPOSE 7860
|
| 18 |
CMD ["bash", "start.sh"]
|
|
|
|
| 1 |
# Hugging Face Space (Docker SDK). Runs the FastAPI backend + Streamlit UI.
|
| 2 |
+
# Follows HF's recommended non-root-user pattern so HOME is writable
|
| 3 |
+
# (Streamlit config/cache + the SQLite file).
|
| 4 |
FROM python:3.12-slim
|
| 5 |
|
| 6 |
+
RUN useradd -m -u 1000 user
|
| 7 |
+
USER user
|
| 8 |
+
ENV HOME=/home/user \
|
| 9 |
+
PATH=/home/user/.local/bin:$PATH \
|
| 10 |
+
SCHED_DB_PATH=/home/user/app/scheduling.db \
|
| 11 |
+
PYTHONUNBUFFERED=1
|
| 12 |
|
| 13 |
+
WORKDIR /home/user/app
|
|
|
|
| 14 |
|
| 15 |
+
COPY --chown=user requirements-space.txt .
|
| 16 |
+
RUN pip install --no-cache-dir --user -r requirements-space.txt
|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
COPY --chown=user app ./app
|
| 19 |
+
COPY --chown=user migrations ./migrations
|
| 20 |
+
COPY --chown=user scripts ./scripts
|
| 21 |
+
COPY --chown=user streamlit_app.py start.sh ./
|
| 22 |
|
| 23 |
EXPOSE 7860
|
| 24 |
CMD ["bash", "start.sh"]
|