FROM python:3.10.12 # Set the working directory WORKDIR /code # Copy and install requirements COPY ./requirements.txt /code/requirements.txt RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt # Install additional system packages RUN apt-get update && apt-get install -y ffmpeg libsm6 libxext6 git # Add a new user RUN useradd -m -u 1000 user # Switch to the new user USER user # Set environment variables ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH # Create application directory and set as working directory WORKDIR $HOME/app # Copy application code and set ownership COPY --chown=user . $HOME/app # Set the command to run the application CMD ["python", "main.py"]