get-chords / Dockerfile
RayPac006's picture
Update Dockerfile
a5c976c verified
raw
history blame contribute delete
747 Bytes
# 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"]