Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +15 -17
Dockerfile
CHANGED
|
@@ -3,30 +3,28 @@ FROM ubuntu:22.04
|
|
| 3 |
RUN apt-get update && apt-get install -y \
|
| 4 |
python3 python3-pip python3-venv \
|
| 5 |
wget curl tar gzip bash jq \
|
| 6 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
|
|
|
|
| 11 |
ENV HOME=/home/user \
|
| 12 |
-
PATH=/home/user/.local/bin:$PATH
|
|
|
|
|
|
|
| 13 |
WORKDIR $HOME/app
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
RUN pip install --no-cache-dir requests webdavclient3 huggingface_hub
|
| 19 |
|
| 20 |
RUN wget -q https://github.com/OpenListTeam/OpenList/releases/download/beta/openlist-linux-amd64.tar.gz && \
|
| 21 |
tar -xzf openlist-linux-amd64.tar.gz && \
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
rm -rf openlist-linux-amd64.tar.gz
|
| 25 |
|
| 26 |
COPY --chown=user . $HOME/app
|
| 27 |
-
COPY --chown=user sync_data.sh $HOME/app/
|
| 28 |
-
RUN chmod +x $HOME/app/sync_data.sh
|
| 29 |
-
RUN chown -R user:user /home/user
|
| 30 |
|
| 31 |
-
|
| 32 |
-
CMD ["/bin/bash", "-c", "$HOME/app/sync_data.sh & sleep 15 && ./openlist server"]
|
|
|
|
| 3 |
RUN apt-get update && apt-get install -y \
|
| 4 |
python3 python3-pip python3-venv \
|
| 5 |
wget curl tar gzip bash jq \
|
| 6 |
+
&& rm -rf /var/lib/apt/lists/* \
|
| 7 |
+
&& adduser --disabled-password --gecos '' --uid 1000 user \
|
| 8 |
+
&& mkdir -p /home/user/data /home/user/app \
|
| 9 |
+
&& chown -R user:user /home/user
|
| 10 |
|
| 11 |
+
USER user
|
| 12 |
ENV HOME=/home/user \
|
| 13 |
+
PATH=/home/user/.local/bin:$PATH \
|
| 14 |
+
VIRTUAL_ENV=/home/user/venv
|
| 15 |
+
|
| 16 |
WORKDIR $HOME/app
|
| 17 |
|
| 18 |
+
RUN python3 -m venv $VIRTUAL_ENV && \
|
| 19 |
+
. $VIRTUAL_ENV/bin/activate && \
|
| 20 |
+
pip install --no-cache-dir requests webdavclient3 huggingface_hub
|
|
|
|
| 21 |
|
| 22 |
RUN wget -q https://github.com/OpenListTeam/OpenList/releases/download/beta/openlist-linux-amd64.tar.gz && \
|
| 23 |
tar -xzf openlist-linux-amd64.tar.gz && \
|
| 24 |
+
chmod +x openlist-linux-amd64/openlist && \
|
| 25 |
+
mv openlist-linux-amd64/openlist ./openlist && \
|
| 26 |
+
rm -rf openlist-linux-amd64.tar.gz openlist-linux-amd64
|
| 27 |
|
| 28 |
COPY --chown=user . $HOME/app
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
CMD ["./openlist", "server"]
|
|
|