| FROM python:3.9 | |
| # Create a user with non-root privileges | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| # Set environment variables | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| # Set working directory | |
| WORKDIR $HOME/app | |
| # Copy application files and requirements | |
| COPY --chown=user . $HOME/app | |
| COPY ./requirements.txt $HOME/app/requirements.txt | |
| # Install dependencies | |
| RUN pip install -r requirements.txt | |
| # Define the default command to run the app | |
| CMD ["chainlit", "run", "app.py", "--port", "8000"] | |