postgres扩展postgis
FROM postgres:13.10
RUN apt-get update
RUN apt-get install -y postgresql-13-postgis-3 postgresql-13-postgis-3-dbgsym postgresql-13-postgis-3-scripts
jetty搭载geoserver
FROM jetty:9.4.51-jdk17
USER root
RUN mkdir /var/lib/jetty/work
# https://udomain.dl.sourceforge.net/project/geoserver/GeoServer/2.23.0/geoserver-2.23.0-war.zip
# https://udomain.dl.sourceforge.net/project/geoserver/GeoServer/2.23.0/extensions/geoserver-2.23.0-vectortiles-plugin.zip
ADD geoserver.war /var/lib/jetty/webapps/
ENV GEOSERVER_DATA_DIR /var/lib/geoserver_data
ENV PATH $PATH:$GEOSERVER_DATA_DIR
自定义python环境
FROM python:3.9.16
# install -y 遇到交互 yes/no 选yes
RUN apt-get update && \
apt-get install -y openssh-server && \
apt-get install -y git && \
apt-get install -y vim
RUN sed -i '/#PermitRootLogin prohibit-password/cPermitRootLogin yes' /etc/ssh/sshd_config
RUN sed -i -e '10aexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib' /etc/profile
RUN sed -i -e '18aservice ssh start' /root/.bashrc
RUN sed -i -e '19asource /etc/profile' /root/.bashrc
RUN echo "root:lqqgis"|chpasswd
RUN mkdir /var/lib/gdal-related-libs
# # 从网上获取GDAL依赖
# # ADD https://www.sqlite.org/2023/sqlite-autoconf-3410200.tar.gz /var/lib/gdal-related-libs
# # ADD https://download.osgeo.org/proj/proj-8.1.0.tar.gz /var/lib/gdal-related-libs
# # ADD https://github.com/Kitware/CMake/releases/download/v3.13.2/cmake-3.13.2.tar.gz /var/lib/gdal-related-libs
# # ADD http://download.osgeo.org/gdal/3.6.3/gdal-3.6.3.tar.gz /var/lib/gdal-related-libs
# 导入GDAL依赖, tar.gz会自动解压,并删除原文件
ADD gdal-related-libs/*.tar.gz /var/lib/gdal-related-libs
# 安装GDAL,每次RUN都是重新进入容器后处理,有路径变动建议写在一起
RUN cd /var/lib/gdal-related-libs && \
cd sqlite-autoconf-3410200 && ./configure && make && make install && ldconfig && \
cd ../proj-8.1.0 && ./configure && make && make check && make install && \
cd ../cmake-3.13.2 && ./bootstrap && make && make install && \
cd ../gdal-3.6.3 && mkdir build && cd build && cmake .. && cmake --build . && cmake --build . --target install && \
cd /var/lib/ && rm -R -f gdal-related-libs
# 安装python包
RUN pip install fastapi[all]==0.95.1 -i https://pypi.tuna.tsinghua.edu.cn/simple && \
pip install requests==2.28.2 -i https://pypi.tuna.tsinghua.edu.cn/simple && \
pip install python-jose==3.3.0 -i https://pypi.tuna.tsinghua.edu.cn/simple && \
pip install passlib==1.7.4 -i https://pypi.tuna.tsinghua.edu.cn/simple && \
pip install SQLAlchemy==1.4.43 -i https://pypi.tuna.tsinghua.edu.cn/simple && \
pip install GeoAlchemy2==0.13.2 -i https://pypi.tuna.tsinghua.edu.cn/simple && \
pip install psycopg2==2.9.6 -i https://pypi.tuna.tsinghua.edu.cn/simple && \
pip install pandas==2.0.0 -i https://pypi.tuna.tsinghua.edu.cn/simple && \
pip install jsonpath==0.82 -i https://pypi.tuna.tsinghua.edu.cn/simple && \
pip install ulid-py==1.1.0 -i https://pypi.tuna.tsinghua.edu.cn/simple && \
pip install Fiona==1.9.3 -i https://pypi.tuna.tsinghua.edu.cn/simple && \
pip install pyproj==3.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple && \
pip install cchardet==2.1.7 -i https://pypi.tuna.tsinghua.edu.cn/simple && \
pip install mapclassify==2.5.0 -i https://pypi.tuna.tsinghua.edu.cn/simple && \
pip install jupyter==1.0.0 -i https://pypi.tuna.tsinghua.edu.cn/simple && \
pip cache purge
EXPOSE 8000
EXPOSE 22
ENTRYPOINT ["/bin/bash"]