mfoud444 commited on
Commit
f8fdbb0
·
verified ·
1 Parent(s): 7aa14e3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -7
Dockerfile CHANGED
@@ -1,19 +1,30 @@
1
  FROM ghcr.io/open-webui/open-webui:main
2
 
3
- # Set the port to 7860 for Hugging Face Spaces
4
- ENV PORT=8080
5
- EXPOSE 8080
6
 
7
- # Configure WebUI settings
 
 
8
  ENV OLLAMA_API_BASE_URL=http://host.docker.internal:11434
9
- ENV WEBUI_SECRET_KEY=random-secret-key-1234
 
 
 
 
 
 
 
 
 
 
10
 
11
  # Persist data volume
12
  VOLUME /app/backend/data
13
 
14
  # Health check
15
- HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
16
- CMD curl -f http://localhost:8080/api/health || exit 1
17
 
18
  # Start command
19
  CMD ["sh", "-c", "python -m uvicorn main:app --host 0.0.0.0 --port ${PORT}"]
 
1
  FROM ghcr.io/open-webui/open-webui:main
2
 
3
+ # Create required directories first
4
+ RUN mkdir -p /app/backend
 
5
 
6
+ # Set environment variables
7
+ ENV PORT=7860
8
+ ENV DISABLE_GIT=true # Disables Git repository initialization
9
  ENV OLLAMA_API_BASE_URL=http://host.docker.internal:11434
10
+ ENV WEBUI_SECRET_KEY=your-secure-key-here-change-me
11
+
12
+ # Create data directory and set permissions
13
+ RUN mkdir -p /app/backend/data && \
14
+ chown -R node:node /app/backend
15
+
16
+ # Switch to non-root user
17
+ USER node
18
+
19
+ # Expose port 7860 for Hugging Face Spaces
20
+ EXPOSE 7860
21
 
22
  # Persist data volume
23
  VOLUME /app/backend/data
24
 
25
  # Health check
26
+ HEALTHCHECK --interval=30s --timeout=10s \
27
+ CMD curl -f http://localhost:7860 || exit 1
28
 
29
  # Start command
30
  CMD ["sh", "-c", "python -m uvicorn main:app --host 0.0.0.0 --port ${PORT}"]