File size: 747 Bytes
ca2d5a5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a5c976c
ca2d5a5
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Use a Python 3.10 base image
FROM python:3.10

# Set up a new user so we don't run as root
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

WORKDIR /app

# 1. Install system dependencies
USER root
RUN apt-get update && apt-get install -y \
    libsndfile1 \
    ffmpeg \
    timidity \
    && rm -rf /var/lib/apt/lists/*
USER user

# 2. Install numpy FIRST and alone
RUN pip install --no-cache-dir numpy==1.24.4

# 3. Install the rest of the requirements
# (Make sure 'numpy' is NOT in your requirements.txt now to avoid conflicts)
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# 4. Copy the rest of your app
COPY --chown=user . .

# 5. Run the app
CMD ["python", "app.py"]