giswqs commited on
Commit
6ae272b
·
1 Parent(s): f84cea7

Update repo

Browse files
Files changed (4) hide show
  1. Dockerfile +14 -20
  2. environment.yml +18 -0
  3. requirements.txt +0 -4
  4. run.sh +0 -1
Dockerfile CHANGED
@@ -1,26 +1,20 @@
1
- FROM jupyter/base-notebook:latest
2
 
3
- RUN mamba install -c conda-forge leafmap geemap mapwidget geopandas localtileserver voila nodejs maplibre typing_extensions==4.11.0 -y && \
4
- pip install -U leafmap && \
5
- fix-permissions "${CONDA_DIR}" && \
6
- fix-permissions "/home/${NB_USER}"
7
 
8
- # COPY requirements.txt .
9
- # RUN pip install --no-cache-dir -r requirements.txt
 
10
 
11
- RUN mkdir ./notebooks
12
- COPY /notebooks ./notebooks
 
13
 
14
- COPY run.sh .
15
 
16
- ENV PROJ_LIB='/opt/conda/share/proj'
 
17
 
18
- USER root
19
- RUN chown -R ${NB_UID} ${HOME}
20
- USER ${NB_USER}
21
-
22
- # RUN jupyter nbextension enable --py --sys-prefix widgetsnbextension
23
-
24
- EXPOSE 8866
25
-
26
- CMD ["/bin/bash", "run.sh"]
 
1
+ FROM condaforge/mambaforge:latest
2
 
3
+ # The HF Space container runs with user ID 1000.
4
+ RUN useradd -m -u 1000 user
5
+ USER user
 
6
 
7
+ # Set home to the user's home directory
8
+ ENV HOME=/home/user \
9
+ PATH=/home/user/.local/bin:$PATH
10
 
11
+ # Set the working directory to the user's home directory
12
+ WORKDIR $HOME/app
13
+ COPY --chown=user . .
14
 
15
+ RUN mamba env create --prefix $HOME/env -f ./environment.yml
16
 
17
+ EXPOSE 7860
18
+ WORKDIR $HOME/app
19
 
20
+ CMD ["mamba", "run", "-p", "/home/user/env", "--no-capture-output", "voila", "--no-browser", "notebooks/"]
 
 
 
 
 
 
 
 
environment.yml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: voila
2
+ channels:
3
+ - conda-forge
4
+ dependencies:
5
+ - python=3.12
6
+ - pip
7
+ - ipykernel
8
+ - jupyterlab
9
+ - leafmap
10
+ - maplibre
11
+ - voila
12
+ - voila_topbar
13
+ - leafmap
14
+ - geemap
15
+ - mapwidget
16
+ - geopandas
17
+ - localtileserver
18
+ - nodejs
requirements.txt DELETED
@@ -1,4 +0,0 @@
1
- voila
2
- geemap
3
- leafmap["maplibre"]
4
-
 
 
 
 
 
run.sh DELETED
@@ -1 +0,0 @@
1
- voila --Voila.ip=0.0.0.0 --no-browser --strip_sources=True --enable_nbextensions=True --MappingKernelManager.cull_interval=60 --MappingKernelManager.cull_idle_timeout=120 --NotebookClient.iopub_timeout=30 notebooks/