noahabebe commited on
Commit
07d5bdf
·
verified ·
1 Parent(s): 3127a6a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -40
Dockerfile CHANGED
@@ -1,55 +1,28 @@
1
  FROM ubuntu:latest
2
 
3
- #RUN apt-get update && apt-get install -y whoami
4
-
5
- RUN whoami
6
-
7
- # Ajouter un utilisateur non-root pour exécuter l'application (recommandé pour des raisons de sécurité)
8
-
9
-
10
- RUN apt update && apt install curl -y
11
 
 
12
  RUN curl -fsSL https://ollama.com/install.sh | sh
13
 
 
14
  ENV OLLAMA_HOST=0.0.0.0
15
 
16
- RUN cut -d: -f1,3 /etc/passwd
17
-
18
- RUN userdel ubuntu && useradd -m -u 1000 appuser
19
-
20
- #RUN chown -R appuser:appuser /home/appuser
21
-
22
- #USER appuser
23
-
24
- #RUN useradd -m -u 1000 appuser
25
- #&& chown -R appuser:appuser /home/appuser
26
-
27
-
28
- # Create the directory and give appropriate permissions
29
  RUN mkdir -p /.ollama && chmod 777 /.ollama
30
- #RUN mkdir -p /home/appuser/.ollama && chmod 777 /home/appuser/.ollama
31
- #RUN mkdir -p /home/appuser/.ollama/models &&
32
-
33
- #USER appuser
34
-
35
- WORKDIR /.ollama
36
-
37
 
38
- #COPY --chown=appuser model_llm_local/model_ollama3 /usr/share/ollama/.ollama/models
39
- COPY --chown=appuser model_llm_local/model_ollama4 /usr/share/ollama/.ollama/models
40
 
41
- #RUN chmod 777 /home/appuser/.ollama/models
42
- # Copy the entry point script
43
- #COPY --chown=appuser entrypoint.sh /entrypoint.sh
44
- #RUN chmod +x /entrypoint.sh
45
 
46
- # Set the entry point script as the default command
47
- #ENTRYPOINT ["/entrypoint.sh"]
48
- CMD ollama serve
49
-
50
- # Set the model as an environment variable (this can be overridden)
51
- #ENV model="nomic-embed-text","yayarun/mixtral_erbot"
52
  ENV OLLAMA_MODELS="/usr/share/ollama/.ollama/models"
53
 
54
  # Expose the server port
55
  EXPOSE 7860
 
 
 
 
1
  FROM ubuntu:latest
2
 
3
+ # Install necessary packages
4
+ RUN apt-get update && apt-get install -y curl
 
 
 
 
 
 
5
 
6
+ # Install Ollama
7
  RUN curl -fsSL https://ollama.com/install.sh | sh
8
 
9
+ # Set environment variable for Ollama host
10
  ENV OLLAMA_HOST=0.0.0.0
11
 
12
+ # Create directory for Ollama and set permissions
 
 
 
 
 
 
 
 
 
 
 
 
13
  RUN mkdir -p /.ollama && chmod 777 /.ollama
 
 
 
 
 
 
 
14
 
15
+ # Create directory for models and set permissions
16
+ RUN mkdir -p /usr/share/ollama/.ollama/models && chmod -R 777 /usr/share/ollama/.ollama/models
17
 
18
+ # Pull the model during the build process
19
+ RUN ollama pull noahabebe/baymax
 
 
20
 
21
+ # Set Ollama models environment variable
 
 
 
 
 
22
  ENV OLLAMA_MODELS="/usr/share/ollama/.ollama/models"
23
 
24
  # Expose the server port
25
  EXPOSE 7860
26
+
27
+ # Run the Ollama server
28
+ CMD ollama serve