Skip to content

Commit

Permalink
Merge pull request #553 from camptocamp/read-only
Browse files Browse the repository at this point in the history
Fix read-only file system
  • Loading branch information
sbrunner authored Jul 21, 2023
2 parents efc445b + 983243f commit 2eec108
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ ENV APACHE_CONFDIR=/etc/apache2 \
# And then a few more from $APACHE_CONFDIR/envvars itself
APACHE_RUN_USER=www-data \
APACHE_RUN_GROUP=www-data \
APACHE_RUN_DIR=/var/run/apache2 \
APACHE_PID_FILE=/var/run/apache2/apache2.pid \
APACHE_RUN_DIR=/tmp/apache2 \
APACHE_PID_FILE=/tmp/apache2/apache2.pid \
APACHE_LOCK_DIR=/var/lock/apache2 \
APACHE_LOG_DIR=/var/log/apache2 \
MS_MAP_PATTERN=^\\/etc\\/mapserver\\/([^\\.][-_A-Za-z0-9\\.]+\\/{1})*([-_A-Za-z0-9\\.]+\\.map)$
Expand All @@ -103,7 +103,8 @@ RUN a2enmod fcgid headers status \
&& sed -ri 's!LogFormat "(.*)" combined!LogFormat "%{us}T %{X-Request-Id}i \1" combined!g' /etc/apache2/apache2.conf \
&& echo 'ErrorLogFormat "%{X-Request-Id}i [%l] [pid %P] %M"' >> /etc/apache2/apache2.conf \
&& sed -i -e 's/<VirtualHost \*:80>/<VirtualHost *:8080>/' /etc/apache2/sites-available/000-default.conf \
&& sed -i -e 's/Listen 80$/Listen 8080/' /etc/apache2/ports.conf
&& sed -i -e 's/Listen 80$/Listen 8080/' /etc/apache2/ports.conf \
&& rm -rf /etc/apache2/conf-enabled/other-vhosts-access-log.conf

EXPOSE 8080

Expand Down
7 changes: 7 additions & 0 deletions acceptance_tests/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
version: '2'

volumes:
tmp:
logs:

services:
# Used to test the server using the MS_MAPFILE environment variable
mapserver:
Expand All @@ -8,12 +12,15 @@ services:
MS_DEBUGLEVEL: '5'
MAPSERVER_CATCH_SEGV: '1'
MS_MAPFILE: /etc/mapserver/mapserver.map
read_only: true
links:
- db
# ports:
# - 8380:8080
volumes:
- ./config/mapserver/:/etc/mapserver
- tmp:/tmp
- logs:/var/log/
user: 12311:12311

# Used to test the server using the MAP parameter of the query string
Expand Down
2 changes: 2 additions & 0 deletions runtime/etc/apache2/conf-enabled/mapserver.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ FcgidBusyTimeout ${BUSY_TIMEOUT}
FcgidIdleTimeout ${IDLE_TIMEOUT}
FcgidIOTimeout ${IO_TIMEOUT}
LimitRequestLine ${APACHE_LIMIT_REQUEST_LINE}
FcgidProcessTableFile /tmp/fcgid_shm
FcgidIPCDir /tmp/mod_fcgid

ScriptAliasMatch "^${MAPSERVER_BASE_PATH}/(.*)" /usr/local/bin/mapserv_wrapper/$1
ScriptAliasMatch "^${MAPSERVER_BASE_PATH}" /usr/local/bin/mapserv_wrapper
Expand Down
2 changes: 1 addition & 1 deletion runtime/usr/local/bin/start-server
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ fi

trap '' WINCH

rm -f "$APACHE_RUN_DIR/apache2.pid"
rm -f "${APACHE_PID_FILE}"

exec apache2 -DFOREGROUND

0 comments on commit 2eec108

Please sign in to comment.