-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile24
More file actions
114 lines (88 loc) · 4.13 KB
/
Dockerfile24
File metadata and controls
114 lines (88 loc) · 4.13 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
# Python Dockerfile
#
# https://github.com/tamboraorg/docker/crepython
#
# Pull base image.
FROM credocker/creubuntu:2024.0
MAINTAINER Michael Kahle <michael.kahle@yahoo.de>
ARG BUILD_YEAR=2024
ARG BUILD_MONTH=0
ARG BUILD_TAG=latest
# version: yyyy.n for stable versions / 0.yyyy for development
LABEL Name="Python for CRE" \
CRE=$CRE_VERSION \
Year=$BUILD_YEAR \
Month=$BUILD_MONTH \
Version=$PYTHON_VERSION \
OS="Ubuntu:$UBUNTU_VERSION" \
Build_=$BUILD_TAG
# install libspatial
RUN apt-get update && apt-get -y --no-install-recommends install libspatialindex-dev && apt-get clean
# install Python
RUN apt-get update && apt-get -y --no-install-recommends install python3-dev python3-plotly && apt-get clean
RUN apt-get -y --no-install-recommends install python3-scipy python3-h5py
RUN uv pip install setuptools wheel psutil pipreqs arrow
RUN uv pip install aiohttp asyncio
## No module named 'gendoc' -> 22.04 only
## RUN uv pip install --upgrade pip
## RUN uv pip install gendoc
## RUN uv pip install datatable
# plotly==5.9 ??
# https://github.com/cgoldberg/xvfbwrapper
RUN uv pip install seaborn plotly kaleido xvfbwrapper
# https://shapely.readthedocs.io/en/2.1.1/manual.html
# https://cartopy.readthedocs.io/stable/
## RUN uv pip install shapely cartopy --no-binary shapely --no-binary cartopy
# PIL: https://pypi.org/project/pillow/
# folium: https://python-visualization.github.io/folium/latest/
RUN uv pip install pillow folium
# rtree==0.9.4 & geopandas==0.6 & xlrd==1.2 & openpyxl==3.0 ??
RUN apt-get -y --no-install-recommends install libgdal-dev
RUN export CPLUS_INCLUDE_PATH=/usr/include/gdal
RUN C_INCLUDE_PATH=/usr/include/gdal
RUN echo $(gdal-config --version)
RUN uv pip install gdal==$(gdal-config --version)
RUN uv pip install scipy rtree geopandas fiona patsy statsmodels xlrd openpyxl geocoder geopy
# beautifulsoup4==4.9 ??
RUN uv pip install connexion beautifulsoup4
#RUN uv pip install pycurl #recommended by jupyterlab
# https://pingouin-stats.org/build/html/index.html
##RUN uv pip install pingouin
RUN uv pip install selenium webdriver-manager selenium-requests
#may change later to own package:
#deep-translator: https://pypi.org/project/deep-translator/
RUN uv pip install deep-translator
#
RUN uv pip install newspaper4k
#RUN uv pip install pythainlp #for thai
#RUN uv pip install newspaper4k[th] #for thai
#RUN uv pip install newspaper4k[all] #for all tokenizers
## Install new chrome ??
## wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb; dpkg -i google-chrome-stable_current_amd64.deb
# OpenCV
RUN apt-get -y --no-install-recommends install python3-opencv
RUN uv pip install opencv-python==4.5.5.64
#FastAPI: https://fastapi.tiangolo.com
RUN uv pip install "fastapi[standard]"
# creTools
# https://github.com/SnakeOilBottles
#RUN pip3 install CreGeoReference==2024.*
RUN pip3 install CreGeoReference
#RUN pip3 install CreLanguageTranslate==2024.*
# Freeze python requirements here:
RUN mkdir -p /cre && \
uv pip freeze --no-cache-dir > /cre/requirements.txt.orig
RUN mkdir -p /cre && touch /cre/versions.txt && \
echo "$(date +'%F %R') \t crePython \t $CRE_VERSION" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t scipy \t $(uv run python -c 'import scipy; print(scipy.__version__)')" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t statsmodels \t $(uv run python -c 'import statsmodels; print(statsmodels.__version__)')" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t geopandas \t $(uv run python -c 'import geopandas; print(geopandas.__version__)')" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t fiona \t $(uv run python -c 'import fiona; print(fiona.__version__)')" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t beautifulsoup4 \t $(uv run python -c 'import beautifulsoup4; print(beautifulsoup4.__version__)')" >> /cre/versions.txt && \
echo "$(date +'%F %R') \t openCV \t $(uv run python -c 'import cv2; print(cv2.__version__)')" >> /cre/versions.txt
COPY cre /cre
WORKDIR /cre/python ## ??
#WORKDIR /cre
#EXPOSE 8000
ENTRYPOINT ["/cre/python-entrypoint.sh"]
CMD ["shoreman", "/cre/python-procfile"]