|
|
|
|
|
FROM ubuntu:22.04 |
|
|
EXPOSE 5244 |
|
|
|
|
|
|
|
|
ENV TZ=Asia/Shanghai |
|
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ |
|
|
echo $TZ > /etc/timezone |
|
|
|
|
|
|
|
|
ENV APP_HOME=/OpenList |
|
|
ENV VIRTUAL_ENV=$APP_HOME/venv |
|
|
|
|
|
|
|
|
RUN apt-get update && \ |
|
|
apt-get install -y wget tar python3 python3-pip && \ |
|
|
rm -rf /var/lib/apt/lists/* && \ |
|
|
python3 -m venv $VIRTUAL_ENV && \ |
|
|
$VIRTUAL_ENV/bin/pip install --no-cache-dir --upgrade pip setuptools wheel && \ |
|
|
$VIRTUAL_ENV/bin/pip install --no-cache-dir huggingface_hub |
|
|
|
|
|
|
|
|
WORKDIR $APP_HOME |
|
|
|
|
|
|
|
|
RUN wget -q https://github.com/OpenListTeam/OpenList/releases/download/beta/openlist-linux-amd64.tar.gz && \ |
|
|
tar -xzf openlist-linux-amd64.tar.gz && \ |
|
|
find . -type f -name "openlist" -exec mv {} . \; && \ |
|
|
rm -rf openlist-linux-amd64.tar.gz *linux-amd64* |
|
|
|
|
|
|
|
|
RUN mkdir -p $APP_HOME/data && \ |
|
|
chmod -R 777 $APP_HOME/data |
|
|
|
|
|
|
|
|
COPY sync_data.sh ./ |
|
|
RUN chmod +x openlist sync_data.sh |
|
|
|
|
|
|
|
|
RUN useradd -m openlistuser && \ |
|
|
chown -R openlistuser:openlistuser $APP_HOME |
|
|
|
|
|
USER openlistuser |
|
|
|
|
|
|
|
|
CMD ["./sync_data.sh"] |