cfjyd1list / Dockerfile
cfjy888's picture
Update Dockerfile
aa31cf3 verified
FROM xhofe/alist:latest
# 安装依赖
RUN apk add --no-cache \
aria2 \
curl \
jq \
python3 \
py3-pip \
tar \
tzdata \
rsync \
&& adduser -D -u 1000 user \
&& mkdir -p /app/config /app/data \
&& chown -R user:user /app
# 配置Python环境
USER user
ENV VIRTUAL_ENV=/app/venv \
PATH="/app/venv/bin:$PATH" \
DATA_DIR="/app/data" \
SYNC_INTERVAL=3600
RUN python3 -m venv $VIRTUAL_ENV && \
pip install --no-cache-dir \
requests==2.31.0 \
webdavclient3==3.14.6 \
tenacity==8.2.3
# 复制同步脚本
COPY --chown=user:user sync_data.sh /app/
RUN chmod +x /app/sync_data.sh
# 声明卷
VOLUME /app/config
VOLUME /app/data
# 健康检查
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:5244/api/public/settings || exit 1
# 暴露端口
EXPOSE 5244 6800
# 启动命令
CMD ["/bin/sh", "-c", "/app/sync_data.sh && aria2c --enable-rpc --rpc-listen-all --rpc-allow-origin-all --rpc-listen-port=6800 --daemon && ./alist server --data /app/config"]