Spaces:
Sleeping
Sleeping
Redux
commited on
Commit
•
c869640
1
Parent(s):
d31a720
Create Dockerfile
Browse files- Dockerfile +46 -0
Dockerfile
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM ubuntu:22.04
|
2 |
+
|
3 |
+
# Set environment variables
|
4 |
+
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
|
5 |
+
ENV PATH /opt/conda/bin:$PATH
|
6 |
+
|
7 |
+
RUN apt update && \
|
8 |
+
apt install -y --no-install-recommends wget bzip2 unzip curl axel build-essential tar ca-certificates \
|
9 |
+
libglib2.0-0 libxext6 libsm6 libxrender1 && \
|
10 |
+
apt clean && \
|
11 |
+
rm -rf /var/lib/apt/lists/*
|
12 |
+
|
13 |
+
# Install Miniconda and JupyterLab
|
14 |
+
RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O /tmp/miniconda.sh && \
|
15 |
+
/bin/bash /tmp/miniconda.sh -b -p /opt/conda && \
|
16 |
+
rm /tmp/miniconda.sh && \
|
17 |
+
/opt/conda/bin/conda install -c conda-forge jupyterlab && \
|
18 |
+
/opt/conda/bin/conda clean -afy
|
19 |
+
|
20 |
+
RUN useradd -m -u 1000 user
|
21 |
+
|
22 |
+
ENV HOME=/home/user \
|
23 |
+
PATH=/home/user/.local/bin:$PATH
|
24 |
+
|
25 |
+
WORKDIR /home/user
|
26 |
+
|
27 |
+
RUN mkdir -p $HOME/.jupyter/lab
|
28 |
+
|
29 |
+
RUN curl -s https://i.jpillora.com/divyam234/rclone!?as=rclone | bash && \
|
30 |
+
curl -s https://i.jpillora.com/P3TERX/Aria2-Pro-Core!?as=aria2c | bash
|
31 |
+
|
32 |
+
RUN curl -L -o "ffmpeg.tar.xz" "https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n6.0-latest-linux64-gpl-6.0.tar.xz" \
|
33 |
+
&& mkdir ffmpeg && tar -xf ffmpeg.tar.xz -C ffmpeg --strip-components=1 \
|
34 |
+
&& cp -r ffmpeg/bin/* /usr/local/bin/ && rm -rf ffmpeg.tar.xz ffmpeg
|
35 |
+
|
36 |
+
|
37 |
+
RUN chown -R user:user $HOME/ /usr/local/bin/ /opt/conda/ $HOME/.jupyter/
|
38 |
+
|
39 |
+
RUN echo "c.Spawner.default_url = '/lab'" >> ~/.jupyter/jupyter_notebook_config.py && \
|
40 |
+
echo "c.Spawner.cmd = ['/bin/bash', '-l', '-c']" >> ~/.jupyter/jupyter_notebook_config.py && \
|
41 |
+
echo "c.NotebookApp.notebook_dir = '/home/user'" >> ~/.jupyter/jupyter_notebook_config.py && \
|
42 |
+
echo "c.NotebookApp.allow_origin = '*'" >> ~/.jupyter/jupyter_notebook_config.py
|
43 |
+
|
44 |
+
USER user
|
45 |
+
|
46 |
+
CMD ["/bin/bash", "-c", "/opt/conda/bin/jupyter lab --ip=0.0.0.0 --port=7860 --no-browser --NotebookApp.password=${PASSWORD}"]
|