File size: 674 Bytes
57528f8 60b3177 91978c4 57528f8 91978c4 57528f8 91978c4 57528f8 91978c4 57528f8 91978c4 57528f8 91978c4 57528f8 7157ed9 91978c4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# 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=7860", "app:app"]
|