-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
109 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
FROM ghcr.io/osgeo/gdal:ubuntu-small-3.8.5 as gdal | ||
FROM ghcr.io/osgeo/gdal:ubuntu-small-3.8.5 AS gdal | ||
|
||
FROM gdal as builder | ||
LABEL maintainer Camptocamp "[email protected]" | ||
FROM gdal AS builder | ||
LABEL maintainer="Camptocamp <[email protected]>" | ||
SHELL ["/bin/bash", "-o", "pipefail", "-cux"] | ||
|
||
RUN --mount=type=cache,target=/var/cache,sharing=locked \ | ||
|
@@ -67,8 +67,8 @@ RUN if test "${WITH_ORACLE}" = "ON"; then \ | |
RUN ninja install \ | ||
&& if test "${WITH_ORACLE}" = "ON"; then rm -rf /usr/local/lib/sdk; fi | ||
|
||
FROM gdal as runner | ||
LABEL maintainer Camptocamp "[email protected]" | ||
FROM gdal AS runner | ||
LABEL maintainer="Camptocamp <[email protected]>" | ||
SHELL ["/bin/bash", "-o", "pipefail", "-cux"] | ||
|
||
# Let's copy a few of the settings from /etc/init.d/apache2 | ||
|
@@ -89,7 +89,8 @@ RUN --mount=type=cache,target=/var/cache,sharing=locked \ | |
&& apt-get upgrade --assume-yes \ | ||
&& apt-get install --assume-yes --no-install-recommends ca-certificates apache2 libapache2-mod-fcgid \ | ||
libfribidi0 librsvg2-2 libpng16-16 libgif7 libfcgi0ldbl \ | ||
libxslt1.1 libprotobuf-c1 libaio1 libpcre2-posix3 glibc-tools | ||
libxslt1.1 libprotobuf-c1 libaio1 libpcre2-posix3 glibc-tools \ | ||
spawn-fcgi lighttpd | ||
|
||
RUN a2enmod fcgid headers status \ | ||
&& a2dismod -f auth_basic authn_file authn_core authz_user autoindex dir \ | ||
|
@@ -122,14 +123,21 @@ ENV MS_DEBUGLEVEL=0 \ | |
MS_ERRORFILE=stderr \ | ||
MAPSERVER_CONFIG_FILE=/etc/mapserver.conf \ | ||
MAPSERVER_BASE_PATH= \ | ||
OGCAPI_HTML_TEMPLATE_DIRECTORY=/usr/local/share/mapserver/ogcapi/templates/html-bootstrap4/ \ | ||
MAX_REQUESTS_PER_PROCESS=1000 \ | ||
MIN_PROCESSES=1 \ | ||
MAX_PROCESSES=5 \ | ||
BUSY_TIMEOUT=300 \ | ||
IDLE_TIMEOUT=300 \ | ||
IO_TIMEOUT=40 \ | ||
APACHE_LIMIT_REQUEST_LINE=8190 \ | ||
GET_ENV=env | ||
GET_ENV=env \ | ||
SERVER=apache \ | ||
LIGHTTPD_CONF=/etc/lighttpd/lighttpd.conf \ | ||
LIGHTTPD_PORT=8080 \ | ||
LIGHTTPD_FASTCGI_HOST=spawn-fcgi \ | ||
LIGHTTPD_FASTCGI_PORT=3000 \ | ||
LIGHTTPD_ACCESSLOG_FORMAT="%h %V %u %t \"%r\" %>s %b" | ||
|
||
CMD ["/usr/local/bin/start-server"] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
server.modules = ( "mod_accesslog", "mod_auth", "mod_fastcgi" ) | ||
|
||
server.document-root = "/none" | ||
server.port = env.LIGHTTPD_PORT | ||
server.errorlog = "/dev/fd/2" | ||
|
||
accesslog.format = env.LIGHTTPD_ACCESSLOG_FORMAT | ||
accesslog.filename = "/dev/fd/2" | ||
|
||
fastcgi.server = ( "" => | ||
( | ||
( | ||
"host" => env.LIGHTTPD_FASTCGI_HOST, | ||
"port" => env.LIGHTTPD_FASTCGI_PORT, | ||
"check-local" => "disable", | ||
), | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,33 @@ | ||
#!/bin/bash -e | ||
|
||
# save the environment to be able to restore it in the FCGI daemon (used | ||
# in /usr/local/bin/qgis_mapsev_wrapper) for the startup code. | ||
${GET_ENV} | sed -e 's/^\([^=]*\)=.*/PassEnv \1/' > /tmp/pass-env | ||
if [ "${SERVER}" == spawn-fcgi ]; then | ||
echo "Starting with spawn-fcgi" | ||
exec /usr/bin/spawn-fcgi -p "${LIGHTTPD_FASTCGI_PORT}" -n -- /usr/local/bin/mapserv | ||
else | ||
if [ "${SERVER}" == lighttpd ]; then | ||
echo "Starting lighttpd" | ||
exec lighttpd -D -f "${LIGHTTPD_CONF}" | ||
else | ||
echo "Starting with apache2" | ||
|
||
# Save the environment to be able to restore it in the FCGI daemon (used in /usr/local/bin/mapserv_wrapper) | ||
${GET_ENV} | sed -e 's/.\+/export "\0"/' > /tmp/init_env | ||
# save the environment to be able to restore it in the FCGI daemon (used | ||
# in /usr/local/bin/qgis_mapsev_wrapper) for the startup code. | ||
${GET_ENV} | sed -e 's/^\([^=]*\)=.*/PassEnv \1/' > /tmp/pass-env | ||
|
||
if [ "${UID}" == 0 ]; then | ||
echo "Switching listen port to 80" | ||
cd /tmp | ||
sed -i -e 's/<VirtualHost \*:8080>/<VirtualHost *:80>/' /etc/apache2/sites-available/000-default.conf | ||
sed -i -e 's/Listen 8080$/Listen 80/' /etc/apache2/ports.conf | ||
fi | ||
# Save the environment to be able to restore it in the FCGI daemon (used in /usr/local/bin/mapserv_wrapper) | ||
${GET_ENV} | sed -e 's/.\+/export "\0"/' > /tmp/init_env | ||
|
||
if [ "${UID}" == 0 ]; then | ||
echo "Switching listen port to 80" | ||
cd /tmp | ||
sed -i -e 's/<VirtualHost \*:8080>/<VirtualHost *:80>/' /etc/apache2/sites-available/000-default.conf | ||
sed -i -e 's/Listen 8080$/Listen 80/' /etc/apache2/ports.conf | ||
fi | ||
|
||
trap '' WINCH | ||
trap '' WINCH | ||
|
||
rm -f "${APACHE_PID_FILE}" | ||
rm -f "${APACHE_PID_FILE}" | ||
|
||
exec apache2 -DFOREGROUND | ||
exec apache2 -DFOREGROUND | ||
fi | ||
fi |