Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +6 -10
Dockerfile
CHANGED
|
@@ -1,19 +1,15 @@
|
|
| 1 |
# Start from a standard Python 3.9 image
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
-
#
|
|
|
|
|
|
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
|
| 10 |
-
|
| 11 |
-
# This is done first to leverage Docker's layer caching
|
| 12 |
-
COPY requirements.txt .
|
| 13 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
-
|
| 15 |
-
# Copy the rest of your backend application code
|
| 16 |
-
COPY . .
|
| 17 |
|
| 18 |
# Command to run your FastAPI app on the port configured in your README.md
|
| 19 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
# Start from a standard Python 3.9 image
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# The two following lines are requirements for the Dev Mode to be functional
|
| 5 |
+
# Learn more about the Dev Mode at https://huggingface.co/dev-mode-explorers
|
| 6 |
+
RUN useradd -m -u 1000 user
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
| 10 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 11 |
|
| 12 |
+
COPY --chown=user . /app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
# Command to run your FastAPI app on the port configured in your README.md
|
| 15 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|