| FROM python:3.9 | |
| # Create a non-root user for security | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR /app | |
| # Copy and install dependencies | |
| COPY --chown=user ./requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Copy the entire project into the container | |
| COPY --chown=user . /app | |
| # Expose the port the app runs on | |
| EXPOSE 7860 | |
| # Default command: launch the Gradio demo. | |
| # Adjust the command-line arguments if necessary. | |
| CMD ["python", "demo/app.py", "--model", "checkpoints/epoch1.pt", "--config", "config/gpt_small.yaml", "--tokenizer", "tokenizer"] | |