Spaces:
Build error
Build error
Upload Dockerfile with huggingface_hub
Browse files- Dockerfile +8 -3
Dockerfile
CHANGED
|
@@ -4,6 +4,8 @@ FROM python:3.9
|
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
wget \
|
| 6 |
git \
|
|
|
|
|
|
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
# Create a non-root user
|
|
@@ -17,11 +19,14 @@ WORKDIR /app
|
|
| 17 |
COPY --chown=user ./requirements.txt requirements.txt
|
| 18 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 19 |
|
|
|
|
|
|
|
|
|
|
| 20 |
# Copy application code
|
| 21 |
COPY --chown=user . /app
|
| 22 |
|
| 23 |
-
#
|
| 24 |
-
RUN
|
| 25 |
|
| 26 |
# Run the application
|
| 27 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
wget \
|
| 6 |
git \
|
| 7 |
+
ffmpeg \
|
| 8 |
+
libsndfile1 \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
# Create a non-root user
|
|
|
|
| 19 |
COPY --chown=user ./requirements.txt requirements.txt
|
| 20 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 21 |
|
| 22 |
+
# Create necessary directories
|
| 23 |
+
RUN mkdir -p /app/audio_files /app/models
|
| 24 |
+
|
| 25 |
# Copy application code
|
| 26 |
COPY --chown=user . /app
|
| 27 |
|
| 28 |
+
# Make directories writable by the user
|
| 29 |
+
RUN chmod -R 755 /app/audio_files /app/models
|
| 30 |
|
| 31 |
# Run the application
|
| 32 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|