subhrajit-mohanty commited on
Commit
9e3f9c1
·
verified ·
1 Parent(s): 30239b4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -15
Dockerfile CHANGED
@@ -1,32 +1,27 @@
1
- # Start with a lightweight base image
2
  FROM ubuntu:20.04
3
 
4
- # Set environment variables
5
  ENV DEBIAN_FRONTEND=noninteractive
6
 
7
- # Update the system and install required packages
8
  RUN apt-get update && apt-get install -y \
9
  curl \
10
  sudo \
11
  unzip \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # Download and install Ollama
15
- RUN curl -fsSL https://ollama.ai/install.sh | bash || \
16
- (echo "Ollama installation failed. Please check the script URL." && exit 1)
 
17
 
18
- # Add Ollama binary to PATH if necessary (modify path based on install location)
19
- ENV PATH="/usr/local/bin:$PATH"
20
- ENV PATH="/usr/local/bin/ollama:$PATH"
21
-
22
- # Verify Ollama installation
23
- RUN which ollama || (echo "Ollama not found in PATH. Please verify installation." && exit 1)
24
 
25
  # Set the working directory
26
  WORKDIR /app
27
 
28
- # Expose port 8050 for the Ollama server
29
  EXPOSE $SPACE_HOST
30
 
31
- # Start the Ollama server on port 8050
32
- CMD ["ollama", "serve", "--port", $SPACE_HOST]
 
 
1
  FROM ubuntu:20.04
2
 
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
 
5
+ # Install prerequisites
6
  RUN apt-get update && apt-get install -y \
7
  curl \
8
  sudo \
9
  unzip \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Download and install Ollama manually
13
+ RUN curl -LO https://ollama.ai/binaries/ollama-linux-amd64 \
14
+ && chmod +x ollama-linux-amd64 \
15
+ && mv ollama-linux-amd64 /usr/local/bin/ollama
16
 
17
+ # Verify installation
18
+ RUN echo $PATH && which ollama || (echo "Ollama not found!" && exit 1)
 
 
 
 
19
 
20
  # Set the working directory
21
  WORKDIR /app
22
 
23
+ # Expose port 8050
24
  EXPOSE $SPACE_HOST
25
 
26
+ # Start the Ollama server
27
+ CMD ["/usr/local/bin/ollama", "serve", "--port", $SPACE_HOST]