-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathDockerfile
More file actions
133 lines (116 loc) · 3.83 KB
/
Dockerfile
File metadata and controls
133 lines (116 loc) · 3.83 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# Data Science Dockerfile with uv and Claude Code
# Base: Astral uv with Python 3.12 on Debian Bookworm
FROM ghcr.io/astral-sh/uv:0.9.30-python3.12-bookworm
LABEL maintainer="Data Science Environment"
LABEL description="Python data science with uv and Claude Code"
# Prevent interactive prompts during package installation
ENV DEBIAN_FRONTEND=noninteractive
# Set up uv environment variables
ENV UV_SYSTEM_PYTHON=1
ENV UV_COMPILE_BYTECODE=1
# ============================================
# Install System Dependencies (Git)
# ============================================
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
jq \
git \
poppler-utils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# ============================================
# Install Geospatial System Libraries (GDAL/GEOS/PROJ)
# ============================================
# Required by fiona (rasterstats dep) and beneficial for rasterio, geopandas, osmnx
RUN apt-get update && apt-get install -y --no-install-recommends \
libgdal-dev \
gdal-bin \
libgeos-dev \
libproj-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# ============================================
# Install Python Data Science Packages via uv
# ============================================
# Install core data science packages
RUN uv pip install --system \
numpy==2.4.2 \
pandas==3.0.0 \
polars==1.38.1 \
scipy==1.17.0 \
openpyxl==3.1.5 \
fastexcel==0.19.0 \
xlrd==2.0.2 \
requests==2.32.5 \
pyarrow==23.0.0 \
urllib3==2.6.3 \
pre-commit==4.5.1 \
scikit-learn==1.8.0 \
umap-learn==0.5.11 \
pyyaml==6.0.3 \
statsmodels==0.14.6 \
pyfixest==0.40.0 \
tabulate==0.10.0 \
great-tables==0.21.0 \
wildboottest==0.3.2
# Install econometrics & statistical modeling packages
# Primary: pyfixest + statsmodels already above
# Secondary: panel models, RDD, marginal effects, volatility, dynamic panels, survey statistics
# NOTE: lifelines excluded — latest (0.30.3) requires pandas<3.0, incompatible with pandas==3.0.0
RUN uv pip install --system \
linearmodels==7.0 \
rdrobust==1.3.0 \
marginaleffects==0.5.0 \
arch==8.0.0 \
pydynpd==0.2.1 \
svy==0.13.0
# Install geospatial packages
# Core: vector (geopandas + deps), raster (rasterio + xarray), mapping, PySAL spatial stats
RUN uv pip install --system \
geopandas==1.1.3 \
rasterio==1.5.0 \
xarray==2026.2.0 \
rioxarray==0.22.0 \
contextily==1.7.0 \
folium==0.20.0 \
libpysal==4.14.1 \
esda==2.9.0 \
spreg==1.9.0 \
mapclassify==2.10.0 \
rasterstats==0.20.0 \
geopy==2.4.1 \
osmnx==2.1.0
# Install visualization packages
RUN uv pip install --system \
matplotlib==3.10.8 \
seaborn==0.13.2 \
plotnine==0.15.3 \
plotly==6.5.2 \
marimo==0.19.11
# Install ML interpretation & fairness packages
RUN uv pip install --system \
shap==0.51.0 \
fairlearn==0.12.0 \
lightgbm==4.6.0
# ============================================
# Create non-root user for security
# ============================================
RUN groupadd --gid 1000 appuser \
&& useradd --uid 1000 --gid 1000 --create-home appuser
# ============================================
# Set up working directory
# ============================================
WORKDIR /daaf
RUN chown appuser:appuser /daaf
USER appuser
# Install Claude Code as appuser (pinned version)
ARG CLAUDE_CODE_VERSION=2.1.87
RUN curl -fsSL https://claude.ai/install.sh | bash -s ${CLAUDE_CODE_VERSION}
ENV PATH="/home/appuser/.local/bin:${PATH}"
# Copy and configure entrypoint script for git initialization
COPY --chown=appuser:appuser scripts/entrypoint.sh /daaf/scripts/entrypoint.sh
RUN chmod +x /daaf/scripts/entrypoint.sh
ENTRYPOINT ["/daaf/scripts/entrypoint.sh"]
# Default command
CMD ["bash"]