forked from mapproxy/mapproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
104 lines (65 loc) · 2.08 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
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
FROM python:3.12-slim-bookworm AS base-libs
LABEL maintainer="mapproxy.org"
RUN apt update && apt -y install --no-install-recommends \
python3-pil \
python3-yaml \
python3-pyproj \
libgeos-dev \
python3-lxml \
libgdal-dev \
python3-shapely \
libxml2-dev \
libxslt-dev && \
apt-get -y --purge autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
FROM base-libs AS builder
RUN mkdir /mapproxy
WORKDIR /mapproxy
COPY setup.py MANIFEST.in README.md CHANGES.txt AUTHORS.txt COPYING.txt LICENSE.txt ./
COPY mapproxy mapproxy
RUN rm -rf dist/*
RUN pip wheel . -w dist
FROM base-libs AS base
RUN mkdir /mapproxy
RUN groupadd mapproxy && \
useradd --home-dir /mapproxy -s /bin/bash -g mapproxy mapproxy && \
chown -R mapproxy:mapproxy /mapproxy
USER mapproxy:mapproxy
WORKDIR /mapproxy
ENV PATH="${PATH}:/mapproxy/.local/bin"
RUN mkdir mapproxy-dist
COPY --from=builder /mapproxy/dist/* mapproxy-dist/
RUN pip install requests riak==2.4.2 redis boto3 azure-storage-blob Shapely && \
pip install --find-links=./mapproxy-dist --no-index MapProxy && \
pip cache purge
COPY docker/app.py .
COPY docker/entrypoint.sh .
ENTRYPOINT ["./entrypoint.sh"]
CMD ["echo", "no CMD given"]
###### development image ######
FROM base AS development
EXPOSE 8080
CMD ["mapproxy-util", "serve-develop", "-b", "0.0.0.0", "/mapproxy/config/mapproxy.yaml"]
##### nginx image ######
FROM base AS nginx
USER root:root
RUN apt update && apt -y install --no-install-recommends nginx gcc \
&& apt-get -y --purge autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
USER mapproxy:mapproxy
RUN pip install uwsgi && \
pip cache purge
COPY docker/uwsgi.conf .
COPY docker/nginx-default.conf /etc/nginx/sites-enabled/default
COPY docker/run-nginx.sh .
EXPOSE 80
USER root:root
RUN chown -R mapproxy:mapproxy /var/log/nginx \
&& chown -R mapproxy:mapproxy /var/lib/nginx \
&& chown -R mapproxy:mapproxy /etc/nginx/conf.d \
&& touch /var/run/nginx.pid \
&& chown -R mapproxy:mapproxy /var/run/nginx.pid
USER mapproxy:mapproxy
CMD ["./run-nginx.sh"]