-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile_NoBase.dockerfile
More file actions
76 lines (66 loc) · 2.16 KB
/
Dockerfile_NoBase.dockerfile
File metadata and controls
76 lines (66 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Use jupyter minimal notebook as base for your image
FROM jupyter/minimal-notebook
# Maintainer
LABEL maintainer="Kamyar Hasanzadeh (kamyar.hasanzadeh@helsinki.fi)"
# ---------- System setup ----------
USER root
ENV HOME=/home/$NB_USER
# Prevent ~/.local from shadowing conda packages
ENV PYTHONNOUSERSITE=1
RUN apt-get update \
&& apt-get install -y --no-install-recommends ssh-client less \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# ---------- Back to non-root ----------
USER $NB_USER
# Remove possible user-site leftovers that could override conda
RUN rm -rf /home/$NB_USER/.local/lib/python3.11/site-packages/osmnx* \
/home/$NB_USER/.local/lib/python3.11/site-packages/geopandas* \
/home/$NB_USER/.local/lib/python3.11/site-packages/shapely* || true
# ---------- Conda config (strict conda-forge) ----------
RUN conda config --add channels conda-forge \
&& conda config --set channel_priority strict \
&& conda install -y -n base mamba \
&& conda clean -afy
# ---------- Create a CLEAN env so base pins don't interfere ----------
# Name it autogis2025 and install everything in ONE transaction
RUN mamba create -y -n autogis2025 \
python=3.11 \
pip \
# ---- Core Python ----
numpy \
pandas \
scipy \
requests \
sqlalchemy \
# ---- Plotting ----
matplotlib \
imageio \
contextily \
folium \
geojson \
mapclassify \
# ---- GIS core (modern & mutually compatible) ----
shapely>=2.0 \
geopandas>=0.13 \
osmnx>=2.0 \
pyproj \
rtree \
rasterio \
rioxarray \
xarray \
owslib \
# ---- Jupyter environment ----
jupyterlab \
jupyterlab-git \
jupyterhub \
notebook \
ipython \
ipykernel \
&& conda clean -afy
# Make the new env the default for everything (shell, python, jupyter)
ENV CONDA_DEFAULT_ENV=autogis2025
ENV PATH=/opt/conda/envs/autogis2025/bin:$PATH
# Register the kernel so Jupyter uses autogis2025 by default
RUN /opt/conda/envs/autogis2025/bin/python -m ipykernel install --user --name autogis2025 --display-name "Python (autogis2025)"
# Build JupyterLab (optional)
RUN jupyter lab build --dev-build=False --minimize=False