Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +31 -0
Dockerfile
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.9-slim
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
# Install curl and Ollama
|
| 5 |
+
RUN apt-get update && apt-get install -y curl && \
|
| 6 |
+
curl -fsSL https://ollama.ai/install.sh | sh && \
|
| 7 |
+
apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
# Set up user and environment
|
| 11 |
+
RUN useradd -m -u 1000 user
|
| 12 |
+
USER user
|
| 13 |
+
ENV HOME=/home/user PATH="/home/user/.local/bin:$PATH"
|
| 14 |
+
WORKDIR $HOME/app
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
# Copy and install Python dependencies
|
| 18 |
+
COPY --chown=user requirements.txt .
|
| 19 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
# Copy the rest of the app
|
| 23 |
+
COPY --chown=user . .
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
# Make the start script executable
|
| 27 |
+
RUN chmod +x start.sh
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
# Start Ollama and the app
|
| 31 |
+
CMD ["./start.sh"]
|