papaduvalier commited on
Commit
8f4f597
·
verified ·
1 Parent(s): 27ab91b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -10
Dockerfile CHANGED
@@ -1,5 +1,7 @@
1
- # Use the official open-webui image as the base
2
- FROM ghcr.io/open-webui/open-webui:main
 
 
3
  RUN mkdir -p /app/backend/open_webui/static
4
  RUN mkdir -p /app/backend/data
5
  RUN mkdir -p /app/cache
@@ -9,13 +11,20 @@ RUN apt-get update && apt-get install -y apache2-utils sqlite3
9
 
10
  # Update the admin password in webui.db by setting secret ORIN_PASSWORD, admin account is [email protected]
11
  COPY webui.db /webui.db
12
- # Expose port 7860 for Hugging Face Spaces
13
- EXPOSE 7860
 
 
14
 
15
- # Set environment variables (OPENAI_API_KEY will be injected via Hugging Face Spaces)
16
- # If needed, you can set defaults or other variables here
17
- ENV PORT=7860
 
 
 
 
 
 
 
18
 
19
- # Command to run the application, ensuring it listens on port 7860
20
- # Run the application using uvicorn, binding to port 7860
21
- CMD ["uvicorn", "open_webui.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM ghcr.io/snekkenull/open-webui:latest
2
+
3
+ WORKDIR /app/backend
4
+
5
  RUN mkdir -p /app/backend/open_webui/static
6
  RUN mkdir -p /app/backend/data
7
  RUN mkdir -p /app/cache
 
11
 
12
  # Update the admin password in webui.db by setting secret ORIN_PASSWORD, admin account is [email protected]
13
  COPY webui.db /webui.db
14
+ RUN --mount=type=secret,id=ORIN_PASSWORD,mode=0444,required=true \
15
+ htpasswd -bnBC 10 "" "$(cat /run/secrets/ORIN_PASSWORD)" | tr -d ':\n' > /tmp/password_hash && \
16
+ sqlite3 /webui.db "UPDATE auth SET password='$(cat /tmp/password_hash)' WHERE email='[email protected]';" && \
17
+ rm /tmp/password_hash
18
 
19
+ # Copy the updated webui.db to the desired location
20
+ RUN cp /webui.db /app/backend/data/webui.db
21
+ # Modify and Copy config.json to set the default lang and preset prompts.
22
+ # COPY config.json /app/backend/data/config.json
23
+
24
+ RUN chmod -R 777 /app/backend/open_webui/static
25
+ RUN chmod -R 777 /app/backend/data
26
+ RUN chmod -R 777 /app/cache
27
+
28
+ EXPOSE 7860
29
 
30
+ CMD ["bash", "start.sh"]