diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 64f19a4c..f965ed62 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -27,6 +27,7 @@ services: aliases: - ${WEBGIS_PUBLIC_HOSTNAME} + g3w-suite: image: g3wsuite/g3w-suite:dev environment: @@ -40,11 +41,19 @@ services: - G3WSUITE_POSTGRES_PORT - G3WSUITE_ORS_API_ENDPOINT - G3WSUITE_ORS_API_KEY + - G3WSUITE_DEBUG - TILESTACHE_CACHE_BUFFER_SIZE - TILESTACHE_CACHE_TOKEN + - G3WSUITE_GUNICORN_NUM_WORKERS + - G3WSUITE_GUNICORN_MAX_REQUESTS - FRONTEND + - PGSERVICEFILE + - QGIS_SERVER_LOG_FILE + - QGIS_SERVER_LOG_LEVEL expose: - "8000" + ports: + - "8000:8000" restart: always logging: driver: "json-file" @@ -52,71 +61,16 @@ services: max-size: "200k" max-file: "10" - depends_on: - - postgis volumes: - ${WEBGIS_DOCKER_SHARED_VOLUME}:/shared-volume - ${WEBGIS_DOCKER_SHARED_VOLUME}/node_modules:/code/node_modules - ./config/g3w-suite/overrides/templates:/code/templates:ro - ./config/g3w-suite/settings_docker.py:/code/g3w-admin/base/settings/local_settings.py + - ./scripts:/scripts + - ${G3WSUITE_LOCAL_CODE_PATH}:/code - networks: - internal: + entrypoint: /scripts/docker-entrypoint-dev.sh - # Asynchronous tasks consumer (run_huey) - g3w-suite-consumer: - image: g3wsuite/g3w-suite:dev - environment: - - G3WSUITE_TILECACHE_PATH - - G3WSUITE_QDJANGO_SERVER_URL - - G3WSUITE_POSTGRES_DBNAME - - G3WSUITE_POSTGRES_USER - - G3WSUITE_POSTGRES_USER_LOCAL - - G3WSUITE_POSTGRES_PASS - - G3WSUITE_POSTGRES_HOST - - G3WSUITE_POSTGRES_PORT - - G3WSUITE_ORS_API_ENDPOINT - - G3WSUITE_ORS_API_KEY - - TILESTACHE_CACHE_BUFFER_SIZE - - TILESTACHE_CACHE_TOKEN - - FRONTEND - restart: always - logging: - driver: "json-file" - options: - max-size: "200k" - max-file: "10" - entrypoint: /scripts/docker-consumer-entrypoint.sh - depends_on: - - g3w-suite - - redis - volumes: - - ${WEBGIS_DOCKER_SHARED_VOLUME}:/shared-volume - - ${WEBGIS_DOCKER_SHARED_VOLUME}/node_modules:/code/node_modules - - ./config/g3w-suite/overrides/templates:/code/templates:ro - - ./config/g3w-suite/settings_docker.py:/code/g3w-admin/base/settings/local_settings.py - networks: - internal: - - nginx: - image: nginx:1.19.5 - ports: - - "8080:8080" - - "443:443" - expose: - - "8080" - volumes: - - ${WEBGIS_DOCKER_SHARED_VOLUME}:/shared-volume - - ${WEBGIS_DOCKER_SHARED_VOLUME}/var/www/.well-known:/var/www/.well-known - - ${WEBGIS_DOCKER_SHARED_VOLUME}/certs/letsencrypt:/etc/letsencrypt:ro - - ./config/g3w-suite/overrides/static:/shared-volume/static/overrides:ro - - ./config/nginx:/etc/nginx/conf.d:ro - logging: - driver: "json-file" - options: - max-size: "200k" - max-file: "10" - restart: always networks: internal: diff --git a/scripts/docker-consumer-entrypoint.sh b/scripts/docker-consumer-entrypoint.sh index 6613ae48..e7a82a7a 100755 --- a/scripts/docker-consumer-entrypoint.sh +++ b/scripts/docker-consumer-entrypoint.sh @@ -1,6 +1,7 @@ #!/bin/bash +# Entrypoint script for consumer images. +# -------------------------------------- -# Starts huey consumer cd /code/g3w-admin diff --git a/scripts/docker-entrypoint-dev.sh b/scripts/docker-entrypoint-dev.sh new file mode 100755 index 00000000..ec9f3c6b --- /dev/null +++ b/scripts/docker-entrypoint-dev.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# Entrypoint script for Development purposes. +# ------------------------------------------- + +# 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 +# Start +cd /code/g3w-admin + +# Build the suite +/code/ci_scripts/build_suite.sh +# Setup once +/code/ci_scripts/setup_suite.sh + +# To get git properties loose on code overrides. +git config --global --add safe.directory /code + +# Start Django server +python3 manage.py runserver 0.0.0.0:8000 \ No newline at end of file diff --git a/scripts/docker-entrypoint.sh b/scripts/docker-entrypoint.sh index 179b6177..7887c4fb 100644 --- a/scripts/docker-entrypoint.sh +++ b/scripts/docker-entrypoint.sh @@ -1,5 +1,6 @@ #!/bin/bash -# Entrypoint script +# Entrypoint script fro deploy production +# --------------------------------------- # Start XVfb if [[ -f /tmp/.X99-lock ]]; then