File size: 748 Bytes
1d6e453
 
 
 
be4f115
1d6e453
45f2214
1d6e453
 
 
be4f115
1d6e453
45f2214
 
 
 
 
1d6e453
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
FROM python:3.11-slim

WORKDIR /app

COPY requirements.txt /app/requirements.txt
COPY sync_webuidb.sh /app/sync_webuidb.sh
COPY icon.png /app/icon.png

RUN apt-get update && apt-get install -y build-essential git curl \
    && rm -rf /var/lib/apt/lists/* \
    && pip install --no-cache-dir -r requirements.txt \
    && chmod +x /app/sync_webuidb.sh \
    && chmod -R 777 /app \
    # Ghi đè nội dung icon nhưng giữ nguyên tên
    && for f in $(find /app/static -type f \( -name "*.png" -o -name "*.ico" -o -name "*.svg" \)); do \
         cp /app/icon.png "$f"; \
    done

ENV HOST=0.0.0.0 PORT=7860 DATA_DIR=/app/data

EXPOSE $PORT

USER root

CMD ["/bin/bash", "-c", "/app/sync_webuidb.sh & open-webui serve --host $HOST --port $PORT"]