Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +8 -31
Dockerfile
CHANGED
|
@@ -1,39 +1,16 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
|
| 4 |
-
RUN apt update && apt install -y git && apt clean
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
HF_HOME=/home/user/huggingface \
|
| 10 |
-
GRADIO_ALLOW_FLAGGING=never \
|
| 11 |
-
GRADIO_NUM_PORTS=1 \
|
| 12 |
-
GRADIO_SERVER_NAME=0.0.0.0 \
|
| 13 |
-
GRADIO_THEME=huggingface \
|
| 14 |
-
SYSTEM=spaces \
|
| 15 |
-
PATH=/home/user/.local/bin:$PATH \
|
| 16 |
-
HOME=/home/user \
|
| 17 |
-
PYTHONPATH=/home/user/app
|
| 18 |
|
| 19 |
-
#
|
| 20 |
-
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
WORKDIR /home/user/app
|
| 24 |
-
|
| 25 |
-
# Copy source as the correct user
|
| 26 |
-
COPY --chown=user . .
|
| 27 |
-
|
| 28 |
-
# Switch to user for safer permissions
|
| 29 |
-
USER user
|
| 30 |
-
|
| 31 |
-
# Install Python dependencies
|
| 32 |
-
COPY requirements.txt /home/user/app/requirements.txt
|
| 33 |
-
RUN pip install --no-cache-dir -r /home/user/app/requirements.txt
|
| 34 |
-
|
| 35 |
-
# Expose the correct port
|
| 36 |
EXPOSE 7860
|
| 37 |
|
| 38 |
# Start the FastAPI app
|
| 39 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
WORKDIR /app
|
|
|
|
| 4 |
|
| 5 |
+
# Install dependencies
|
| 6 |
+
COPY requirements.txt .
|
| 7 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
+
# Copy FastAPI app
|
| 10 |
+
COPY app.py .
|
| 11 |
|
| 12 |
+
# Expose the port Hugging Face Spaces expects
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
EXPOSE 7860
|
| 14 |
|
| 15 |
# Start the FastAPI app
|
| 16 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|