Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +32 -0
Dockerfile
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use a Python 3.10 base image
|
| 2 |
+
FROM python:3.10
|
| 3 |
+
|
| 4 |
+
# Set up a new user so we don't run as root
|
| 5 |
+
RUN useradd -m -u 1000 user
|
| 6 |
+
USER user
|
| 7 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 8 |
+
|
| 9 |
+
WORKDIR /app
|
| 10 |
+
|
| 11 |
+
# 1. Install system dependencies
|
| 12 |
+
USER root
|
| 13 |
+
RUN apt-get update && apt-get install -y \
|
| 14 |
+
libsndfile1 \
|
| 15 |
+
ffmpeg \
|
| 16 |
+
timidity \
|
| 17 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 18 |
+
USER user
|
| 19 |
+
|
| 20 |
+
# 2. Install numpy FIRST and alone
|
| 21 |
+
RUN pip install --no-cache-dir numpy==1.26.4
|
| 22 |
+
|
| 23 |
+
# 3. Install the rest of the requirements
|
| 24 |
+
# (Make sure 'numpy' is NOT in your requirements.txt now to avoid conflicts)
|
| 25 |
+
COPY --chown=user requirements.txt .
|
| 26 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 27 |
+
|
| 28 |
+
# 4. Copy the rest of your app
|
| 29 |
+
COPY --chown=user . .
|
| 30 |
+
|
| 31 |
+
# 5. Run the app
|
| 32 |
+
CMD ["python", "app.py"]
|