Skip to content

Commit

Permalink
Refactoring docker-compose-dev.yml and relative files for local devel…
Browse files Browse the repository at this point in the history
…opment.
  • Loading branch information
wlorenzetti committed Jun 3, 2022
1 parent 172a2ed commit 8810468
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 60 deletions.
70 changes: 12 additions & 58 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ services:
aliases:
- ${WEBGIS_PUBLIC_HOSTNAME}


g3w-suite:
image: g3wsuite/g3w-suite:dev
environment:
Expand All @@ -40,83 +41,36 @@ 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"
options:
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:

Expand Down
3 changes: 2 additions & 1 deletion scripts/docker-consumer-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
# Entrypoint script for consumer images.
# --------------------------------------

# Starts huey consumer

cd /code/g3w-admin

Expand Down
24 changes: 24 additions & 0 deletions scripts/docker-entrypoint-dev.sh
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion scripts/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash
# Entrypoint script
# Entrypoint script fro deploy production
# ---------------------------------------

# Start XVfb
if [[ -f /tmp/.X99-lock ]]; then
Expand Down

0 comments on commit 8810468

Please sign in to comment.