File size: 748 Bytes
2b956f2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Use an official lightweight Linux distribution as a base
FROM ubuntu:22.04

# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive

# Update and install essential dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    curl \
    wget \
    git \
    ca-certificates \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

# Install Ollama
RUN curl -fsSL https://ollama.com/install.sh | sh

# Set up a non-root user for better security and permissions
RUN useradd -m -u 1000 user
USER user

# Set the working directory
WORKDIR /home/user/app

# Expose the port the app will use (default for Ollama is 11434)
EXPOSE 11434

# Command to pull the model and serve it
CMD ["ollama", "pull", "nomic-embed-text"]