Skip to content

Commit

Permalink
Use Mapserver 8 for arm (Mac M2/M2)
Browse files Browse the repository at this point in the history
  • Loading branch information
MBARIMike committed Dec 4, 2023
1 parent 4585fe2 commit cb65464
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 247 deletions.
7 changes: 3 additions & 4 deletions docker/Dockerfile-mapserver-arm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mapserver/mapserver:v7.4.2
FROM --platform=linux/arm64 camptocamp/mapserver:8.0-gdal3.6-arm64

USER root

Expand All @@ -9,9 +9,8 @@ RUN apt-get update -y && apt-get install -y libfcgi-dev fcgiwrap nginx
# Set up the Nginx Mapserver configuration.
ADD mapserver.tmpl /etc/nginx/sites-available/mapserver

# Override default fcgiwrap init.d script for Mac M1/2
ADD mapserver-arm-init.d /etc/init.d/fcgiwrap
RUN chmod +x /etc/init.d/fcgiwrap
# Config file new in Mapserver 8: https://mapserver.org/mapfile/config.html
ADD mapserver.conf /usr/local/etc/

RUN ln -s /etc/nginx/sites-available/mapserver /etc/nginx/sites-enabled/mapserver
RUN rm /etc/nginx/sites-enabled/default
Expand Down
12 changes: 12 additions & 0 deletions docker/Dockerfile-postgis-arm
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# https://github.com/postgis/docker-postgis/issues/216#issuecomment-1763399631
FROM imresamu/postgis:15-3.4

# The base image already has 'postgis.sh' under /docker-entrypoint-initdb.d/.
# Since the initialization files will be executed in sorted name order,
# we name our init script such that it's processed after 'postgis.sh'.
COPY postgis-init-db.sh /docker-entrypoint-initdb.d/

# Modify pg_hba.conf and pg_ident.conf.
# Note: handled as a script (and not via RUN command in the docker file)
# so /var/lib/postgresql/data/ already exists by the time the logic is run.
COPY postgis-pg_hba.sh /docker-entrypoint-initdb.d/
4 changes: 2 additions & 2 deletions docker/docker-compose-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ services:
build:
context: .
dockerfile: Dockerfile-mapserver-arm
platform: linux/amd64/v2
volumes:
- ${STOQS_VOLS_DIR}/maps:${URL_MAPFILE_DIR}:ro
container_name: stoqs-mapserver
# Expose port 80 if PRODUCTION=false - Note: PRODUCTION=false doesn't work (March 2019)
##ports:
## - "80:80"
restart: always
environment:
- MAPSERVER_CONFIG_FILE=/usr/local/etc/mapserver.conf
env_file:
- ./.env

Expand Down Expand Up @@ -95,7 +96,6 @@ services:
build:
context: .
dockerfile: Dockerfile-nginx
platform: linux/amd64/v2
volumes:
- ${STOQS_VOLS_DIR}/html:/srv/html
- ${STOQS_VOLS_DIR}/pg_dumps:/srv/media-files/pg_dumps
Expand Down
241 changes: 0 additions & 241 deletions docker/mapserver-arm-init.d

This file was deleted.

57 changes: 57 additions & 0 deletions docker/mapserver.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#
# Sample MapServer 8.0 Config File (https://mapserver.org/mapfile/config.html)
#
CONFIG

#
# Environment variables
#
ENV
#
# Limit Mapfile Access
#
# MS_MAP_NO_PATH "1"
MS_MAP_PATTERN "^/maps" ## required when referencing mapfiles by path
# MS_MAP_BAD_PATTERN "[/\\]{2}|[/\\]?\\.+[/\\]|,"

#
# Global Log/Debug Setup
#
# MS_DEBUGLEVEL "5"
# MS_ERRORFILE "/opt/mapserver/logs/mapserver.log"

#
# Proj Library
#
# PROJ_LIB "/usr/local/share/proj"

#
# Default Map
#
# MS_MAPFILE "/opt/mapserver/test/test.map"

# disable POST requests (allowed by default, any value will do)
# MS_NO_POST "1"

#
# Other Options
#
# MS_ENCRYPTION_KEY "/opt/mapserver/mykey.txt"
# MS_USE_GLOBAL_FT_CACHE 1 # use a global font cache
# MS_PDF_CREATION_DATE "01/02/2022" # PDF create date metadata
# MS_MAPFILE_PATTERN "\.map$"
# MS_XMLMAPFILE_XSLT "/path/to/mapfile.xsl"
# MS_MODE "BROWSE" # default mode for CGI calls
# MS_OPENLAYERS_JS_URL "http://openlayers.org/api/OpenLayers.js"
# MS_TEMPPATH "/tmp"
# MS_MAX_OPEN_FILES 200 # maximum number of open files allowed on Windows
END

#
# Map aliases
#
MAPS
TEST_MAPFILE "/opt/mapserver/test/test.map"
END

END

0 comments on commit cb65464

Please sign in to comment.