Upload Dockerfile
Browse files- Dockerfile +26 -0
Dockerfile
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
# Install the C++ Compiler required for llama-cpp-python
|
| 4 |
+
RUN apt-get update && apt-get install -y build-essential python3-dev
|
| 5 |
+
|
| 6 |
+
# Set up a new user to avoid running as root
|
| 7 |
+
RUN useradd -m -u 1000 user
|
| 8 |
+
USER user
|
| 9 |
+
ENV HOME=/home/user \
|
| 10 |
+
PATH=/home/user/.local/bin:$PATH
|
| 11 |
+
|
| 12 |
+
# Set the working directory
|
| 13 |
+
WORKDIR $HOME/app
|
| 14 |
+
|
| 15 |
+
# Copy the requirements and install them
|
| 16 |
+
COPY --chown=user requirements.txt .
|
| 17 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
+
|
| 19 |
+
# Copy all the app files (including the .gguf model)
|
| 20 |
+
COPY --chown=user . .
|
| 21 |
+
|
| 22 |
+
# Hugging Face Spaces exposes port 7860
|
| 23 |
+
EXPOSE 7860
|
| 24 |
+
|
| 25 |
+
# Run Chainlit on port 7860
|
| 26 |
+
CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860", "--headless"]
|