| FROM openlistteam/openlist:latest AS builder |
|
|
| FROM ubuntu:latest |
|
|
| WORKDIR /app |
|
|
| COPY --from=builder /opt/openlist/ . |
|
|
| # RUN chmod 777 /app/openlist/openlist |
| # RUN sudo mv /app/openlist/openlist /usr/local/bin/openlist |
|
|
| COPY /data/* /app/data |
|
|
| RUN apt update && apt install curl -y && apt install sudo git ffmpeg -y |
|
|
| ENV OPENLIST_ADMIN_PASSWORD 123321 |
| ENV TZ Asia/Shanghai |
|
|
| RUN chmod 777 /app/openlist |
|
|
| RUN curl -sSf https: |
|
|
| EXPOSE 7860 |
|
|
|
|
| CMD ["/bin/bash", "-c", "\ |
| # 后台启动openlist(加&),避免卡住后续命令 |
| /app/openlist start & \ |
| # 确保openlist启动完成 |
| sleep 2 && \ |
| # 启动sshx(后台运行,避免占用终端) |
| sshx &&\ |
| # 进入交互式bash终端(保持容器运行) |
| /bin/bash \ |
| "] |
| # cd openlist2/openlist && \ |
| # git pull && \ |
| # # git config --global advice.addIgnoredFile false && \ |
| # git config --global user.email "you@example.com" && \ |
| # git config --global user.name "Your Name" && \ |
| # git add data/config.json && git add data/data.db && git commit -m 'update data [skip ci]' && git |