forked from yagajs/docker-mapproxy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
77 lines (67 loc) · 2.64 KB
/
Dockerfile
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
FROM python:3.11-slim-bookworm
# Notes by Just van den Broecke
# July 2020
# The original image (from 2019), based on Debian Buster Python3 was around 1GB.
# Slimmed down to 294MB by:
# - using Debian Slim image.
# - Using https://github.com/geopython/pygeoapi/blob/master/Dockerfile as example.
# - avoided building wheels by installing python- packages
# - removing build dependency packages.
#
# Upgrade notes: Debian bullseye-slim (follow up from Buster) has Python 3.8
# Currently compat problem with MP 1.12.0 because of "cgi" packages
# See issue: https://github.com/mapproxy/mapproxy/issues/462
# like wsgi-plugin-python3 (needs to wait)
#
# Upgrade notes: in bullseye: use libproj19 uwsgi-plugin-python3 (i.s.o. pip3 uwsgi)
# --plugin /usr/lib/uwsgi/plugins/python3_plugin.so in uwsgi command and remove --wsgi-disable-file-wrapper
# May 2024
# * Python 3.11 and MapProxy 2.0.2
# * upgrade Base image to python:3.11-slim-bookworm
# * drop support for EPSG:900913
# * patch TMS demo HTML
LABEL original_developer="Arne Schubert <[email protected]>"
LABEL contributor="Just van den Broecke <[email protected]>"
# Build ARGS
ARG TZ="Europe/Amsterdam"
ARG LOCALE="en_US.UTF-8"
# Only adds 1MB and handy tools
ARG ADD_DEB_PACKAGES="curl xsltproc libxml2-utils patch"
ARG ADD_PIP_PACKAGES=""
ARG MAPPROXY_VERSION="2.0.2"
# ENV settings
ENV MAPPROXY_PROCESSES="4" \
MAPPROXY_THREADS="2" \
UWSGI_EXTRA_OPTIONS="" \
DEBIAN_FRONTEND="noninteractive" \
PROJ_DATA="/usr/share/proj" \
PYTHONPATH="/usr/lib/python3/dist-packages" \
DEB_BUILD_DEPS="build-essential libpcre2-dev" \
DEB_PACKAGES="python3-pil python3-yaml python3-pyproj libgeos-dev python3-lxml libgdal-dev python3-shapely libxml2-dev libxslt-dev uwsgi-plugin-python3 ${ADD_DEB_PACKAGES}" \
PIP_PACKAGES="uwsgi requests geojson watchdog MapProxy==${MAPPROXY_VERSION} ${ADD_PIP_PACKAGES}"
RUN set -x \
&& apt update \
&& apt install --no-install-recommends -y ${DEB_BUILD_DEPS} ${DEB_PACKAGES} ${ADD_DEB_PACKAGES} \
&& useradd -ms /bin/bash mapproxy \
&& mkdir -p /mapproxy \
&& chown mapproxy /mapproxy \
&& pip3 install ${PIP_PACKAGES} ${ADD_PIP_PACKAGES} \
&& mkdir -p /docker-entrypoint-initmapproxy.d \
&& pip3 uninstall --yes wheel \
&& pip3 cache purge \
&& ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \
&& apt-get remove --yes --purge ${DEB_BUILD_DEPS} \
&& apt-get --yes --purge autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY patches/ /patches
RUN cd /patches && ./apply.sh && cd -
COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["mapproxy"]
USER mapproxy
# Why needed? See examples.
# VOLUME ["/mapproxy"]
EXPOSE 8080
# Stats
EXPOSE 9191