Update Dockerfile
Browse files- Dockerfile +15 -17
Dockerfile
CHANGED
|
@@ -1,24 +1,22 @@
|
|
| 1 |
FROM ghcr.io/open-webui/open-webui:main
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
|
| 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
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
RUN
|
| 17 |
-
|
| 18 |
-
chown -R nobody:nogroup /app/backend/data
|
| 19 |
|
| 20 |
-
# Switch to
|
| 21 |
-
USER
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
-
# Run the start
|
| 24 |
-
CMD ["
|
|
|
|
| 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"]
|