Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +6 -13
Dockerfile
CHANGED
@@ -7,7 +7,7 @@ ENV DEBIAN_FRONTEND=noninteractive
|
|
7 |
# Set working directory
|
8 |
WORKDIR /app
|
9 |
|
10 |
-
# Install system dependencies
|
11 |
RUN apt-get update && apt-get install -y \
|
12 |
curl \
|
13 |
python3 \
|
@@ -17,7 +17,6 @@ RUN apt-get update && apt-get install -y \
|
|
17 |
ca-certificates \
|
18 |
sudo \
|
19 |
dos2unix \
|
20 |
-
git \
|
21 |
&& rm -rf /var/lib/apt/lists/*
|
22 |
|
23 |
# Create and activate virtual environment
|
@@ -32,10 +31,6 @@ RUN pip install --no-cache-dir --upgrade pip && \
|
|
32 |
# Install Ollama
|
33 |
RUN curl -fsSL https://ollama.ai/install.sh | sh
|
34 |
|
35 |
-
# Create ollama directories with proper permissions
|
36 |
-
RUN mkdir -p /app/.ollama/models && \
|
37 |
-
chmod -R 777 /app/.ollama
|
38 |
-
|
39 |
# Copy application files
|
40 |
COPY app.py .
|
41 |
COPY startup.sh .
|
@@ -43,13 +38,11 @@ COPY startup.sh .
|
|
43 |
# Fix line endings and make startup script executable
|
44 |
RUN dos2unix startup.sh && chmod +x startup.sh
|
45 |
|
46 |
-
#
|
47 |
-
|
48 |
-
|
49 |
-
# Set environment variables for Ollama
|
50 |
ENV OLLAMA_HOST=0.0.0.0:11434
|
51 |
-
ENV OLLAMA_MODELS=/
|
52 |
-
ENV OLLAMA_HOME=/
|
53 |
|
54 |
# Expose ports
|
55 |
EXPOSE 7860 11434
|
@@ -58,5 +51,5 @@ EXPOSE 7860 11434
|
|
58 |
HEALTHCHECK --interval=30s --timeout=30s --start-period=60s --retries=3 \
|
59 |
CMD curl -f http://localhost:7860/health || exit 1
|
60 |
|
61 |
-
# Start both Ollama server and FastAPI app
|
62 |
CMD ["/bin/bash", "./startup.sh"]
|
|
|
7 |
# Set working directory
|
8 |
WORKDIR /app
|
9 |
|
10 |
+
# Install system dependencies
|
11 |
RUN apt-get update && apt-get install -y \
|
12 |
curl \
|
13 |
python3 \
|
|
|
17 |
ca-certificates \
|
18 |
sudo \
|
19 |
dos2unix \
|
|
|
20 |
&& rm -rf /var/lib/apt/lists/*
|
21 |
|
22 |
# Create and activate virtual environment
|
|
|
31 |
# Install Ollama
|
32 |
RUN curl -fsSL https://ollama.ai/install.sh | sh
|
33 |
|
|
|
|
|
|
|
|
|
34 |
# Copy application files
|
35 |
COPY app.py .
|
36 |
COPY startup.sh .
|
|
|
38 |
# Fix line endings and make startup script executable
|
39 |
RUN dos2unix startup.sh && chmod +x startup.sh
|
40 |
|
41 |
+
# Set environment variables for Ollama (using /tmp for guaranteed write access)
|
42 |
+
ENV HOME=/tmp
|
|
|
|
|
43 |
ENV OLLAMA_HOST=0.0.0.0:11434
|
44 |
+
ENV OLLAMA_MODELS=/tmp/ollama/models
|
45 |
+
ENV OLLAMA_HOME=/tmp/ollama
|
46 |
|
47 |
# Expose ports
|
48 |
EXPOSE 7860 11434
|
|
|
51 |
HEALTHCHECK --interval=30s --timeout=30s --start-period=60s --retries=3 \
|
52 |
CMD curl -f http://localhost:7860/health || exit 1
|
53 |
|
54 |
+
# Start both Ollama server and FastAPI app
|
55 |
CMD ["/bin/bash", "./startup.sh"]
|