# Base image with Python 3.9 FROM python:3.9 # Create a user and set permissions RUN useradd -m -u 1000 user # Set the working directory in the container WORKDIR /app # Copy requirements file and set ownership COPY --chown=user ./requirements.txt requirements.txt # Install dependencies RUN pip install --no-cache-dir --upgrade -r requirements.txt # Copy the entire application directory and set ownership COPY --chown=user . /app # Expose Flask default port EXPOSE 5000 # Run the Flask app CMD ["python", "app.py"]