-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.erb
More file actions
107 lines (85 loc) · 3.4 KB
/
Dockerfile.erb
File metadata and controls
107 lines (85 loc) · 3.4 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
FROM bcit.io/alpine:latest as build
WORKDIR /src
COPY qgis-plugins/<%= image.vars['dataplotly_filename'] %> .
COPY qgis-plugins/<%= image.vars['lizmap_filename'] %> .
COPY qgis-plugins/<%= image.vars['geojson_filename'] %> .
RUN ls -alh
RUN unzip <%= image.vars['dataplotly_filename'] %> \
&& unzip <%= image.vars['lizmap_filename'] %> \
&& unzip <%= image.vars['geojson_filename'] %> \
&& ls -alh
FROM debian:<%= image.vars['debian_codename'] %>-slim
<%= snippet('labels', binding) -%>
<%= snippet('docker-entrypoint', binding) -%>
<%= snippet('tini', binding) -%>
ENV LANG=en_EN.UTF-8
####
# QGIS Setup
COPY data/qgis.sources /etc/apt/sources.list.d/qgis.sources
RUN apt-get --assume-yes update \
&& apt-get install --no-install-recommends --no-install-suggests --allow-unauthenticated -y \
gnupg \
software-properties-common \
ca-certificates \
wget \
locales \
python3-pip \
&& localedef -i en_US -f UTF-8 en_US.UTF-8 \
# Add the current key for package downloading
# Please refer to QGIS install documentation (https://www.qgis.org/fr/site/forusers/alldownloads.html#debian-ubuntu)
&& mkdir -m755 -p /etc/apt/keyrings \
&& wget -O /etc/apt/keyrings/qgis-archive-keyring.gpg https://download.qgis.org/downloads/qgis-archive-keyring.gpg \
# Add repository for latest version of qgis-server
# Please refer to QGIS repositories documentation if you want other version (https://qgis.org/en/site/forusers/alldownloads.html#repositories)
&& echo "deb [signed-by=/etc/apt/keyrings/qgis-archive-keyring.gpg] https://qgis.org/debian-ltr bullseye main" | tee /etc/apt/sources.list.d/qgis.list \
&& apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests --allow-unauthenticated -y \
qgis-providers-common \
python3-qgis-common \
qgis-server \
python3-qgis \
spawn-fcgi \
xauth \
xvfb \
&& apt-get remove --purge -y \
gnupg \
wget \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -m qgis
ENV QGIS_PREFIX_PATH /usr
ENV QGIS_SERVER_LOG_STDERR 1
ENV QGIS_SERVER_LOG_LEVEL 0
COPY --chown=qgis:qgis cmd.sh /home/qgis/cmd.sh
RUN chmod -R 777 /home/qgis/cmd.sh /usr/lib/qgis/plugins
COPY --from=build --chown=qgis:qgis /src/DataPlotly/ /usr/lib/qgis/plugins/DataPlotly
COPY --from=build --chown=qgis:qgis /src/lizmap_server/ /usr/lib/qgis/plugins/lizmap_server
COPY --from=build --chown=qgis:qgis /src/qgis_server_render_geojson/ /usr/lib/qgis/plugins/qgis_server_render_geojson
RUN ls -alh /usr/lib/qgis/plugins/
####
# QGIS Plugin
# setup qgis-plugin-manager and upgrade qgis plugins
ENV QGIS_PLUGINPATH /usr/lib/qgis/plugins/
RUN pip3 install qgis-plugin-manager --break-system-packages
RUN cd /usr/lib/qgis/plugins
RUN qgis-plugin-manager init
RUN qgis-plugin-manager update
RUN qgis-plugin-manager upgrade
####
# DataPlotly
RUN apt-get install --no-install-recommends --no-install-suggests --allow-unauthenticated -y \
python3-plotly \
python3-pyqt5.qtwebkit
####
# GEOJSON
# Location where geojson style and geojson files are stored
ENV QGIS_RENDERGEOJSON_PREFIX /usr/lib/qgis/plugins/qgis_server_render_geojson/data
####
# # LizMap
# ENV rootRepositories
# ENV QGIS_OPTIONS_PATH
ENV QGIS_SERVER_LIZMAP_REVEAL_SETTINGS TRUE
USER qgis
WORKDIR /home/qgis
ENTRYPOINT ["/tini", "--", "/docker-entrypoint.sh"]
CMD ["/home/qgis/cmd.sh"]
# CMD [ "init-loop" ]