Skip to content

Commit

Permalink
move DISPLAY and QGIS_SERVER_PARALLEL_RENDERING into `docker-comp…
Browse files Browse the repository at this point in the history
…ose.yml`

Related to: #75 (comment)
  • Loading branch information
Raruto committed Nov 7, 2022
1 parent 7ee5ee5 commit c33fe58
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
12 changes: 7 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
version: "3.4"

x-g3w-suite-env: &g3w-suite-env
- DISPLAY=:99
- FRONTEND
- G3WSUITE_GUNICORN_MAX_REQUESTS
- G3WSUITE_GUNICORN_NUM_WORKERS
Expand All @@ -23,6 +24,7 @@ x-g3w-suite-env: &g3w-suite-env
- QGIS_OPTIONS_PATH=/shared-volume/
- QGIS_SERVER_LOG_FILE
- QGIS_SERVER_LOG_LEVEL
- QGIS_SERVER_PARALLEL_RENDERING=1
- TILESTACHE_CACHE_BUFFER_SIZE
- TILESTACHE_CACHE_TOKEN

Expand All @@ -35,7 +37,7 @@ x-g3w-suite-vol: &g3w-suite-vol
- ./secrets/pg_service.conf:${PGSERVICEFILE}
- ./config/qgis/QGIS3.ini:/shared-volume/QGIS/QGIS3.ini

x-g3w-suite-logging: &x-g3w-suite-logging
x-g3w-suite-logging: &g3w-suite-logging
driver: "json-file"
options:
max-size: "200k"
Expand All @@ -53,7 +55,7 @@ services:
- ALLOW_IP_RANGE=0.0.0.0/0
restart: on-failure
logging:
*x-g3w-suite-logging
*g3w-suite-logging
volumes:
- ${WEBGIS_DOCKER_SHARED_VOLUME}:/var/lib/postgresql
healthcheck:
Expand All @@ -74,7 +76,7 @@ services:
- "8000"
restart: always
logging:
*x-g3w-suite-logging
*g3w-suite-logging
depends_on:
- postgis
volumes:
Expand All @@ -96,7 +98,7 @@ services:
*g3w-suite-env
restart: always
logging:
*x-g3w-suite-logging
*g3w-suite-logging
entrypoint: /scripts/docker-consumer-entrypoint.sh
depends_on:
- g3w-suite
Expand All @@ -119,7 +121,7 @@ services:
- ${WEBGIS_DOCKER_SHARED_VOLUME}/certs/letsencrypt:/etc/letsencrypt:ro
- ./config/nginx:/etc/nginx/conf.d:ro
logging:
*x-g3w-suite-logging
*g3w-suite-logging
restart: always
networks:
internal:
Expand Down
2 changes: 0 additions & 2 deletions scripts/docker-consumer-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ if [[ "${G3WSUITE_RUN_HUEY}" =~ [Tt][Rr][Uu][Ee] ]] ; then
# Wait for the main suite to start
wait-for-it -h g3w-suite -p 8000 -t 60

export QGIS_SERVER_PARALLEL_RENDERING=1

cd /code/g3w-admin

ls /usr/local/lib/python3.6/dist-packages/
Expand Down
9 changes: 4 additions & 5 deletions scripts/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
#!/bin/bash
# Entrypoint script fro deploy production
# Entrypoint script for deploy production
# ---------------------------------------

# Start XVfb
if [[ -f /tmp/.X99-lock ]]; then
rm /tmp/.X99-lock
fi
Xvfb :99 -screen 0 640x480x24 -nolisten tcp &
export DISPLAY=:99
export QGIS_SERVER_PARALLEL_RENDERING=1
Xvfb ${DISPLAY:-:99} -screen 0 640x480x24 -nolisten tcp &

# Start
cd /code/g3w-admin

Expand All @@ -27,7 +26,7 @@ if [[ "${FRONTEND}" =~ [Tt][Rr][Uu][Ee] ]] ; then
fi
fi

# TODO: move this into a more appropriate location
# TODO: move this into a more appropriate location (eg. g3w-admin ?)
if [ ! -f /shared-volume/gunicorn.conf.py ]; then
cat > /shared-volume/gunicorn.conf.py << EOF
import os
Expand Down

0 comments on commit c33fe58

Please sign in to comment.