# Use a Python base image FROM python:3.9-slim # Set the working directory inside the container WORKDIR /code # Copy the required files to the working directory COPY app.py . COPY ./templates/index.html /code/templates/index.html COPY ./requirements.txt /code/requirements.txt # Install the required packages RUN pip install --no-cache-dir -r /code/requirements.txt RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH WORKDIR $HOME/app COPY --chown=user . $HOME/app # Expose the port that the Flask app will run on EXPOSE 7860 # Start the Flask app CMD ["python", "app.py"]