# Base image with Python 3.9 FROM python:3.10.12 # Create a new user with a home directory and set it as the current user RUN useradd -m -u 1000 user USER user # Add the local Python package directory to PATH ENV PATH="/home/user/.local/bin:$PATH" # Set the working directory WORKDIR /app # Copy the requirements file and install dependencies COPY --chown=user ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt # Copy the entire application code to the container COPY --chown=user . /app # Define the default command to run the Flask app using Waitress CMD ["waitress-serve", "--host=0.0.0.0", "--port=10000", "app:app"]