-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
65 lines (58 loc) · 1.63 KB
/
Dockerfile
File metadata and controls
65 lines (58 loc) · 1.63 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
FROM docker.io/python:3.12.12-slim-bookworm AS base
# 1. Environment & basic settings
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
# 2. Install system dependencies (needed for geopandas, prophet, etc.)
# - build-essential: compilers for building some wheels from source
# - gdal, proj, geos: geospatial stack for geopandas
# - curl, ca-certificates: good to have for network access / TLS
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
build-essential \
g++ \
gcc \
gfortran \
libgdal-dev \
gdal-bin \
libproj-dev \
proj-bin \
libgeos-dev \
libgeos++-dev \
libspatialindex-dev \
libxml2-dev \
libxslt1-dev \
liblapack-dev \
libblas-dev \
git \
curl \
ca-certificates && \
rm -rf /var/lib/apt/lists/*
# 3. Optional: create a dedicated directory and (if you like) a venv
WORKDIR /app
# If you prefer a virtualenv instead of installing into the global site-packages:
# RUN python -m venv /opt/venv
# ENV PATH="/opt/venv/bin:$PATH"
# 4. Upgrade pip once
RUN python -m pip install --upgrade pip
# 5. Install Python dependencies in a single layer
RUN pip install --no-cache-dir \
requests \
pandas \
numpy \
geopandas \
matplotlib \
seaborn \
folium \
wordcloud \
scipy \
scikit-learn \
prophet \
arch \
sympy \
pm4py \
thefuzz \
reportlab
# 6. Default command (you can override in docker run / compose)
CMD ["python"]