| FROM python:3.9 | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| # Set the working directory inside the container | |
| WORKDIR /app | |
| # Clone the repo to current directory | |
| RUN git clone https://github.com/nishantprime/Web-Databases.git . | |
| # Install Python dependencies listed in requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Copy the rest of the application code from the host to the container | |
| COPY --chown=user . /app | |
| # Specify the command to run the application with Gunicorn | |
| CMD ["gunicorn", "app:app", "-b", "0.0.0.0:7860"] |