Update Dockerfile
Browse files- Dockerfile +28 -22
Dockerfile
CHANGED
@@ -1,30 +1,36 @@
|
|
1 |
-
FROM
|
2 |
|
3 |
-
|
4 |
-
ENV HOST=0.0.0.0
|
5 |
|
6 |
-
USER root
|
7 |
-
|
8 |
-
# Sao chép các file cần thiết
|
9 |
-
COPY sync_webuidb.sh /app/sync_webuidb.sh
|
10 |
COPY requirements.txt /app/requirements.txt
|
|
|
11 |
COPY icon.png /app/icon.png
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
#
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
done
|
26 |
|
27 |
-
|
|
|
|
|
|
|
|
|
28 |
|
29 |
-
|
30 |
-
CMD bash -c "/app/sync_webuidb.sh & ./start.sh"
|
|
|
1 |
+
FROM python:3.11-slim
|
2 |
|
3 |
+
WORKDIR /app
|
|
|
4 |
|
|
|
|
|
|
|
|
|
5 |
COPY requirements.txt /app/requirements.txt
|
6 |
+
COPY sync_webuidb.sh /app/sync_webuidb.sh
|
7 |
COPY icon.png /app/icon.png
|
8 |
|
9 |
+
RUN apt-get update && apt-get install -y build-essential git curl findutils \
|
10 |
+
&& rm -rf /var/lib/apt/lists/* \
|
11 |
+
&& pip install --no-cache-dir -r requirements.txt \
|
12 |
+
&& chmod +x /app/sync_webuidb.sh \
|
13 |
+
&& chmod -R 777 /app && \
|
14 |
+
# Tìm tất cả static folder trong site-packages/backend/open_webui
|
15 |
+
for STATIC_DIR in $(find /usr/local/lib/python3.11/site-packages -type d -path "*/backend/open_webui/static"); do \
|
16 |
+
echo "Patching icons in: $STATIC_DIR"; \
|
17 |
+
if ls "$STATIC_DIR"/*.png 1>/dev/null 2>&1; then \
|
18 |
+
for file in "$STATIC_DIR"/*.png; do \
|
19 |
+
[ "$file" != "/app/icon.png" ] && cp /app/icon.png "$file"; \
|
20 |
+
done; \
|
21 |
+
fi; \
|
22 |
+
if ls "$STATIC_DIR"/*.svg 1>/dev/null 2>&1; then \
|
23 |
+
for svg in "$STATIC_DIR"/*.svg; do \
|
24 |
+
png="${svg%.svg}.png"; \
|
25 |
+
[ "$png" != "/app/icon.png" ] && cp /app/icon.png "$png"; \
|
26 |
+
done; \
|
27 |
+
fi; \
|
28 |
done
|
29 |
|
30 |
+
ENV HOST=0.0.0.0 PORT=7860 DATA_DIR=/app/data
|
31 |
+
|
32 |
+
EXPOSE $PORT
|
33 |
+
|
34 |
+
USER root
|
35 |
|
36 |
+
CMD ["/bin/bash", "-c", "/app/sync_webuidb.sh & open-webui serve --host $HOST --port $PORT"]
|
|