File size: 585 Bytes
0fb8e0d
8af09d7
0fb8e0d
 
 
 
8af09d7
0fb8e0d
 
 
8af09d7
0fb8e0d
 
8af09d7
0fb8e0d
8af09d7
0fb8e0d
 
8af09d7
0fb8e0d
 
 
 
 
 
 
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
FROM ollama/ollama AS base

# Create the /.ollama directory and ensure it has the right permissions
USER root
RUN mkdir -p /.ollama && \
    chmod -R 777 /.ollama

# Copy your scripts and set them up
COPY ollama-pull.sh /ollama-pull.sh
RUN chmod +x /ollama-pull.sh

# Switch to your application's user if it doesn't require root
# USER appuser

ENV model="llama2"

# Run your script as the last step of the build process
RUN /ollama-pull.sh

FROM base AS final-stage

# Setup entrypoint and default command
ENTRYPOINT ["/bin/ollama"]
EXPOSE 11434
ENV OLLAMA_HOST 0.0.0.0
CMD ["serve"]