papaduvalier commited on
Commit
24df8f2
·
verified ·
1 Parent(s): 0981fb3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +54 -8
Dockerfile CHANGED
@@ -1,14 +1,60 @@
1
- FROM ghcr.io/open-webui/open-webui:dev
 
 
 
 
 
 
 
 
 
 
 
2
  WORKDIR /app/backend
3
 
4
- COPY sync_data.sh sync_data.sh
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  # Set permissions for directories
6
- RUN chmod -R 777 /app/backend/static && \
7
- chmod -R 777 /app/backend/data && \
8
- chmod -R 777 /app/cache && \
9
- mkdir -p /data/.ollama/models && \
10
- mkdir -p /root/.ollama && \
11
- chmod -R 777 /data
12
 
13
  # Expose the necessary port
14
  EXPOSE 7760
 
1
+ FROM ghcr.io/open-webui/open-webui:latest
2
+ RUN apt-get update && apt-get install -y sudo
3
+
4
+ # Create a new user with a disabled password
5
+ RUN adduser --uid 1000 --gid 1000 --home /home/user --shell /bin/bash --disabled-password user
6
+
7
+ # Add the user to the sudo group
8
+ RUN usermod -aG sudo user
9
+
10
+ # Switch to the newly created user
11
+ USER user
12
+
13
  WORKDIR /app/backend
14
 
15
+ # Set environment variables
16
+ ARG GID=0
17
+ ARG UID=1000
18
+ ENV HOME /home/user
19
+
20
+ # Create user and directories
21
+ RUN sudo mkdir -p /app/backend/static && \
22
+ sudo mkdir -p /app/backend/data && \
23
+ sudo mkdir -p /app/backend/data/docs && \
24
+ sudo mkdir -p /app/cache && \
25
+ sudo mkdir -p /data && \
26
+ sudo mkdir -p /run/secrets && \
27
+ echo monteiro2502 > /run/secrets/ORIN_PASSWORD
28
+
29
+ RUN apt-get update && apt-get install -y apache2-utils sqlite3
30
+
31
+ # Copy the requirements.txt file into the container
32
+ COPY requirements.txt /app/backend/
33
+
34
+ # Install Python packages from requirements.txt
35
+ #RUN pip3 install --no-cache-dir -r /app/backend/requirements.txt
36
+
37
+ # Update the password in webui.db
38
+ COPY webui2.db /webui.db
39
+ RUN sudo --mount=type=secret,id=ORIN_PASSWORD,mode=0444,required=true \
40
+ htpasswd -bnBC 10 "" "$(cat /run/secrets/ORIN_PASSWORD)" | tr -d ':\n' > /tmp/password_hash && \
41
+ sqlite3 /webui.db "UPDATE auth SET password='$(cat /tmp/password_hash)' WHERE email='vilarin@huggingface.co';" && \
42
+ sudo rm /tmp/password_hash
43
+
44
+ # Copy the updated webui.db to the desired location
45
+ RUN sudo cp /webui.db /app/backend/data/webui.db
46
+
47
+ # Copy the test script and set permissions
48
+ COPY test_ollama.sh /app/backend
49
+ RUN sudo chmod 777 /app/backend/test_ollama.sh
50
+
51
  # Set permissions for directories
52
+ RUN sudo chmod -R 777 /app/backend/static && \
53
+ sudo chmod -R 777 /app/backend/data && \
54
+ sudo chmod -R 777 /app/cache && \
55
+ sudo mkdir -p /data/.ollama/models && \
56
+ sudo mkdir -p /root/.ollama && \
57
+ sudo chmod -R 777 /data
58
 
59
  # Expose the necessary port
60
  EXPOSE 7760