Skip to content

Commit

Permalink
⬆️ Bump kartoza/postgis from 15-3.3 to 16-3.4 (#120)
Browse files Browse the repository at this point in the history
* Add script for PG upgrade.

* Add drop databases

* Add update postgis command.

* Add create database statement

* Update script for update db cluster

* Use of template1 as db for connection.

* Add IMPORTANT message.

* Change

* Move warning message to the top.

* Add instructions for PostgreSQL migration.

* `UPGRADE_PG_DB_FROM_11_TO_16.md` → `README.md`

* Delete UPGRADE_PG_DB_FROM_11_TO_16.md

* Create entrypoint.sh

* Update docker-compose-dev.yml

* Update README.md

* Update entrypoint.sh

* Delete update_postgres_11_to_16_BASE.sh

* Delete upgrade_postgres_11_to_16_BACKUP.sh

* Delete upgrade_postgres_11_to_16_RESTORE.sh

* Update to qgis 3.34

* Create `Makefile`

* Update Makefile

* Update Makefile

* Update README.md

* Update README.md

* Update docker-compose-dev.yml

* Delete scripts/postgis/entrypoint.sh

* create `/scripts/makefile/folder`

* Update `Makefile`

* Update `run_certbot.sh`

* Update README.md

* Update docker-compose-consumer.yml

* Update docker-compose-dev.yml

* check for Windows_NT

* mispelling

* Update Makefile

* Update README_DEV.md

* Update Makefile

* Update db-restore.sh

* Update db-backup.sh

* Update README.md

* Update README.md

* Update README.md

* Update .env.example

* Update README.md

* Update README.md

* Update README.md

* Update makefile

* Update makefile

* `make demo ENV=dev`

* wrong gitignore

* missing projects

* Update makefile

* Update db-restore.sh

* Update db-restore.sh

* Update db-restore.sh

* figlet

* Create `gunicorn.conf.py`

* Update docker-entrypoint-dev.sh

* Update docker-entrypoint.sh

* replace: `sleep` → `pg_isready`

* replace: `make demo` → `make db-reset`

* pg_isready to 90 s.

* Instructions for prod.

* add helper: `make run-%`

* Update README_DEV.md

* echo

* missing demo files

---------

Co-authored-by: wlorenzetti <[email protected]>
Co-authored-by: Raruto <[email protected]>
  • Loading branch information
3 people authored Jun 18, 2024
1 parent 73f8129 commit a9d038a
Show file tree
Hide file tree
Showing 26 changed files with 18,360 additions and 253 deletions.
14 changes: 7 additions & 7 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# Public hostmane
# Public hostname, for docker internal network aliases
WEBGIS_PUBLIC_HOSTNAME=dev.g3wsuite.it

# Shared volume mount (docker internal: shared-volume)
# I suggest not to use the /tmp/ folder, /tmp/ folder is cleaned at each reboot
# Persistent data folder (projects, database, uploads), mounted into "g3w-suite" container at: `/shared-volume`
WEBGIS_DOCKER_SHARED_VOLUME=./shared-volume

# Docker internal DB
##
# 🚨 PostGIS DB
##
G3WSUITE_POSTGRES_USER_LOCAL=g3wsuite
G3WSUITE_POSTGRES_PASS='89#kL8y3D'
G3WSUITE_POSTGRES_DBNAME=g3wsuite
G3WSUITE_POSTGRES_HOST=postgis
G3WSUITE_POSTGRES_PORT=5432

# Set this to true to activate the frontend module
# OPTIONAL: whether activate frontend module
FRONTEND=False

# QGIS Server env variables
# ----------------------------------------------------

# Put your pg service into ./secrets/pg_service.conf file, the conf file will be mounted into
# docker container at runtime a the PGSERVICEFILE
# To use PostgreSql Service, mounted into postgis container at: `./secrets/pg_service.conf`,
PGSERVICEFILE=/pg_service/pg_service.conf

QGIS_SERVER_LOG_FILE=/shared_volume/QGIS/error.log
Expand Down
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,15 @@ projects
.idea
code

shared-volume
shared-volume/**

# DEMO DATA
!shared-volume/backup/
!shared-volume/backup/demo/
!shared-volume/backup/demo/**
!shared-volume/media/
!shared-volume/media/project_data/
!shared-volume/media/project_data/spatialite/
!shared-volume/media/project_data/spatialite/**
!shared-volume/media/projects/
!shared-volume/media/projects/3857_public-building-management-demo.qgs
84 changes: 84 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
ifeq ($(ENV),)
$(error ENV is not set)
endif

##
# Ensure: "Docker Desktop > Resources > WSL Integration"
##
ifeq ($(OS), Windows_NT)
$(error make.exe not supported, please try again within a WSL shell: https://docs.docker.com/desktop/wsl/#enabling-docker-support-in-wsl-2-distros)
endif

##
# ENV = { dev | prod | consumer }
##
ifeq ($(ENV), prod)
DOCKER_COMPOSE:= docker compose -f docker-compose.yml
else
DOCKER_COMPOSE:= docker compose -f docker-compose-$(ENV).yml
endif

G3W_SUITE:= docker compose exec g3w-suite


##
# SSH login
#
# make run-g3wsuite ENV=DEV
# make run-postgis ENV=DEV
##
run-%:
$(DOCKER_COMPOSE) start $*
docker exec -it $$(docker ps | grep $* | head -1 | awk '{print $$1}') bash

##
# Recreate g3w-suite containers
#
# make db-reset ENV=dev
##
db-reset:
$(DOCKER_COMPOSE) up -d
$(G3W_SUITE) bash -c 'rm -rf /shared-volume/cache'
$(G3W_SUITE) bash -c 'rm -rf /shared-volume/__pycache__'
$(G3W_SUITE) bash -c 'rm -f /shared-volume/build_done'
$(G3W_SUITE) bash -c 'rm -f /shared-volume/setup_done'
$(G3W_SUITE) bash -c 'rm -f /shared-volume/.secret_key'
$(DOCKER_COMPOSE) up -d --force-recreate
ID=demo ./scripts/makefile/db-restore.sh

##
# Backup databases
#
# make db-backup ID=name ENV=dev
##
db-backup:
./scripts/makefile/db-backup.sh

##
# Restore databases
#
# make db-restore ID=name ENV=dev
##
db-restore:
$(DOCKER_COMPOSE) up -d --force-recreate
./scripts/makefile/db-restore.sh

##
# Run certbot
#
# make renew-ssl ENV=dev
##
renew-ssl:
./scripts/makefile/renew-ssl.sh
$(DOCKER_COMPOSE) up -d --force-recreate

##
# Rebuild docker image
#
# make docker-image v=v3.8.x
##
docker-image:
ifeq ($(v),)
$(error v is not set)
endif
docker build -f Dockerfile.g3wsuite.dockerfile -t g3wsuite/g3w-suite:$(v) --no-cache .
Loading

0 comments on commit a9d038a

Please sign in to comment.