Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ RUN chown -R 999:999 /srv/ && chown -R 999:999 /etc/apache2/
# maps
COPY --chown=999:999 . /srv/mapserver/
RUN for i in /srv/mapserver/*.map; do echo $i; done

RUN : "${MAP_URL:?MAP_URL not set}" \
&& : "${LEGEND_URL:?LEGEND_URL not set}" \
&& for i in /srv/mapserver/*.map; do sed -i 's#MAP_URL_REPLACE#'"$MAP_URL"'#g' $i ; sed -i 's#LEGEND_URL_REPLACE#'"$LEGEND_URL"'#g' $i; done
&& find /srv/mapserver /srv/mapserver/referentiekaarten -maxdepth 1 -type f -name "*.map" -exec sed -i -e "s#MAP_URL_REPLACE#${MAP_URL}#g" -e "s#LEGEND_URL_REPLACE#${LEGEND_URL}#g" {} +

RUN rm -rf /srv/mapserver/private
RUN python3 /srv/mapserver/tools/make_indexjson.py /srv/mapserver/*.map > /srv/mapserver/index.json

Expand Down
11 changes: 11 additions & 0 deletions Dockerfile.private
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ ARG BASE_IMAGE

FROM ${BASE_IMAGE}

# build-time inputs
ARG EXTRA_ARG1
ARG EXTRA_ARG2

ENV MAP_URL="${EXTRA_ARG1:-http://localhost:8383}" \
LEGEND_URL="${EXTRA_ARG2:-http://localhost:8383}"

# used by make_mapfile_config.py to include private mapfiles in sld config
ENV ACCESS_SCOPE private
USER root
Expand All @@ -10,4 +17,8 @@ USER root
# private variety.
RUN rm -rf /srv/mapserver/private
COPY --chown=999:999 /private/ /srv/mapserver/
RUN : "${MAP_URL:?MAP_URL not set}" \
&& : "${LEGEND_URL:?LEGEND_URL not set}" \
&& find /srv/mapserver -maxdepth 1 -type f -name "*.map" -exec sed -i -e "s#MAP_URL_REPLACE#${MAP_URL}#g" -e "s#LEGEND_URL_REPLACE#${LEGEND_URL}#g" {} +

USER www-data
11 changes: 11 additions & 0 deletions Dockerfile.topografie
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,20 @@ ARG BASE_IMAGE

FROM ${BASE_IMAGE}

# build-time inputs
ARG EXTRA_ARG1
ARG EXTRA_ARG2

ENV MAP_URL="${EXTRA_ARG1:-http://localhost:8383}" \
LEGEND_URL="${EXTRA_ARG2:-http://localhost:8383}"

USER root
# Copy referentiekaarten mapfiles into the root dir so they will be served

RUN rm -rf /srv/mapserver/private
COPY --chown=999:999 /referentiekaarten/ /srv/mapserver/
RUN : "${MAP_URL:?MAP_URL not set}" \
&& : "${LEGEND_URL:?LEGEND_URL not set}" \
&& find /srv/mapserver -maxdepth 1 -type f -name "*.map" -exec sed -i -e "s#MAP_URL_REPLACE#${MAP_URL}#g" -e "s#LEGEND_URL_REPLACE#${LEGEND_URL}#g" {} +

USER www-data