Spaces:
Runtime error
Runtime error
Upload Dockerfile
Browse files- Dockerfile +7 -4
Dockerfile
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
# Use
|
| 2 |
-
FROM python:3.
|
| 3 |
|
| 4 |
# Set working directory within the container
|
| 5 |
WORKDIR /code
|
|
@@ -10,7 +10,7 @@ COPY ./requirements.txt /code/requirements.txt
|
|
| 10 |
# Install Python dependencies
|
| 11 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 12 |
|
| 13 |
-
# Install ffmpeg
|
| 14 |
RUN apt update && apt install -y ffmpeg
|
| 15 |
|
| 16 |
# Create a non-root user
|
|
@@ -32,5 +32,8 @@ COPY --chown=user . $HOME/app
|
|
| 32 |
# Expose port 7860 (assuming your FastAPI app runs on this port)
|
| 33 |
EXPOSE 7860
|
| 34 |
|
|
|
|
|
|
|
|
|
|
| 35 |
# Command to run the FastAPI application
|
| 36 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# Use Python 3.9 as base image
|
| 2 |
+
FROM python:3.9
|
| 3 |
|
| 4 |
# Set working directory within the container
|
| 5 |
WORKDIR /code
|
|
|
|
| 10 |
# Install Python dependencies
|
| 11 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 12 |
|
| 13 |
+
# Install ffmpeg (if needed)
|
| 14 |
RUN apt update && apt install -y ffmpeg
|
| 15 |
|
| 16 |
# Create a non-root user
|
|
|
|
| 32 |
# Expose port 7860 (assuming your FastAPI app runs on this port)
|
| 33 |
EXPOSE 7860
|
| 34 |
|
| 35 |
+
# Ensure PyTorch is installed
|
| 36 |
+
RUN pip install torch torchvision torchaudio
|
| 37 |
+
|
| 38 |
# Command to run the FastAPI application
|
| 39 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|