Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +17 -9
Dockerfile
CHANGED
@@ -1,19 +1,27 @@
|
|
1 |
FROM python:3.10
|
2 |
|
|
|
3 |
WORKDIR /python-docker
|
4 |
|
5 |
-
|
6 |
-
USER user
|
7 |
-
|
8 |
COPY requirements.txt requirements.txt
|
9 |
-
RUN apt-get update && apt-get install git
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
RUN python -c "from transformers import pipeline; pipeline('automatic-speech-recognition', model='openai/whisper-small')"
|
13 |
-
COPY . .
|
14 |
|
15 |
-
|
|
|
16 |
|
|
|
17 |
EXPOSE 8001
|
18 |
|
19 |
-
|
|
|
|
1 |
FROM python:3.10
|
2 |
|
3 |
+
# Set the working directory
|
4 |
WORKDIR /python-docker
|
5 |
|
6 |
+
# Copy the requirements file and install dependencies
|
|
|
|
|
7 |
COPY requirements.txt requirements.txt
|
8 |
+
RUN apt-get update && apt-get install -y git ffmpeg
|
9 |
+
|
10 |
+
# Install Python dependencies without caching
|
11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
+
|
13 |
+
# Create cache directories for Hugging Face and set permissions
|
14 |
+
RUN mkdir -p /python-docker/.cache/huggingface && \
|
15 |
+
chown -R 1000:1000 /python-docker/.cache
|
16 |
+
|
17 |
+
# Install Whisper model to ensure it's available
|
18 |
RUN python -c "from transformers import pipeline; pipeline('automatic-speech-recognition', model='openai/whisper-small')"
|
|
|
19 |
|
20 |
+
# Copy the entire application
|
21 |
+
COPY --chown=1000:1000 . .
|
22 |
|
23 |
+
# Expose the port the app runs on
|
24 |
EXPOSE 8001
|
25 |
|
26 |
+
# Set the command to run the application
|
27 |
+
CMD ["uvicorn", "fastapi_app:app", "--host", "0.0.0.0", "--port", "8001"]
|