Spaces:
Paused
Paused
| FROM ghcr.io/open-webui/open-webui:main | |
| # 复制字体文件 | |
| COPY fonts/* /app/build/assets/fonts/ | |
| # 复制自定义CSS和JS文件 | |
| COPY custom.css /app/build/assets/ | |
| COPY custom.js /app/build/assets/ | |
| # 在</head>标签前添加custom.css引用 | |
| RUN sed -i 's|</head>|<link rel="stylesheet" href="/assets/custom.css"></head>|' /app/build/index.html && \ | |
| sed -i 's|</body>|<script src="/assets/custom.js"></script></body>|' /app/build/index.html | |
| # 安装Redis | |
| RUN apt-get update && apt-get install -y redis-server | |
| # 修改Redis配置和权限 | |
| RUN mkdir -p /var/run/redis && \ | |
| chown -R 1000:1000 /var/run/redis && \ | |
| chown -R 1000:1000 /var/lib/redis && \ | |
| chmod 777 /var/run/redis | |
| # 创建启动Redis的脚本 | |
| # 创建启动Redis的脚本 | |
| RUN echo "#!/bin/bash" > redis-start.sh && \ | |
| echo 'redis-server --daemonize yes --save "" --appendonly no --requirepass ${REDIS_PASSWORD}' >> redis-start.sh && \ | |
| echo "sleep 2" >> redis-start.sh && \ | |
| echo "echo 'Redis status:'" >> redis-start.sh && \ | |
| echo 'redis-cli -a ${REDIS_PASSWORD} ping' >> redis-start.sh | |
| COPY sync_data.sh sync_data.sh | |
| RUN chmod -R 777 ./data && \ | |
| sed -i "1r sync_data.sh" ./start.sh && \ | |
| sed -i "1r redis-start.sh" ./start.sh | |