bardd commited on
Commit
5d2bd4d
·
verified ·
1 Parent(s): 0a3f8e8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -17
Dockerfile CHANGED
@@ -1,24 +1,22 @@
1
  FROM ghcr.io/open-webui/open-webui:main
2
 
3
- # Set environment variables
4
- ENV ENV=production \
5
- WEBUI_AUTH=false \
6
- OPENAI_API_BASE_URL=https://api.deepinfra.com/v1/openai \
7
- OPENAI_API_KEY=Qkg36ZyeOllw5Y7ARp3Xr7Gmq8JmR13B
8
-
9
- # Expose the application port
10
- EXPOSE 8080
11
 
12
  # Set the working directory
13
- WORKDIR /app/backend
14
 
15
- # Make sure the start.sh script is executable and set permissions for the database directory
16
- RUN chmod +x start.sh && \
17
- mkdir -p /app/backend/data && \
18
- chown -R nobody:nogroup /app/backend/data
19
 
20
- # Switch to a non-root user
21
- USER nobody
 
 
 
 
 
22
 
23
- # Run the start.sh script
24
- CMD ["./start.sh"]
 
1
  FROM ghcr.io/open-webui/open-webui:main
2
 
3
+ # Create a non-root user
4
+ RUN useradd -m -u 1000 webuser
 
 
 
 
 
 
5
 
6
  # Set the working directory
7
+ WORKDIR /app
8
 
9
+ # Create necessary directories and set permissions
10
+ RUN mkdir -p /app/backend/data && \
11
+ chown -R webuser:webuser /app
 
12
 
13
+ # Switch to the non-root user
14
+ USER webuser
15
+
16
+ # Set environment variables
17
+ ENV HOME=/home/webuser \
18
+ PATH=/home/webuser/.local/bin:$PATH \
19
+ WEBUI_SECRET_KEY=/app/backend/data/.webui_secret_key
20
 
21
+ # Run the start script
22
+ CMD ["/app/backend/start.sh"]