Run a self hosted web-gis application with Docker Compose
Install docker compose.
Clone this repository:
git clone https://github.com/g3w-suite/g3w-suite-docker/
cd g3w-suite-docker
Create a .env
file starting from .env.example
and tailor it to your needs:
# CHANGE ME: PostGIS DB password
- G3WSUITE_POSTGRES_PASS='89#kL8y3D'
+ G3WSUITE_POSTGRES_PASS=<your__password>
Start containers:
docker-compose up -d
or, if you intend to use huey (batch processing)
docker-compose -f docker-compose-consumer.yml up -d
NB: at the very first start, have a lot of patience 😴 → the system must finalize the installation. *
After some time the suite will be available at:
admin
, pass: admin
)* in case of faulty container (eg. the first time you didn't wait long enough before trying to access):
# 🚨 deletes all data
make db-reset ENV=prod
# or
# make db-reset ENV=consumer
$ make run-postgis ENV=prod
# make run-g3w-suite ENV=prod
# make run-nginx ENV=prod
# make run-redis ENV=prod
root@84ef6a8d23e6:/# su - postgres
postgres@84ef6a8d23e6:~$ psql
psql (11.2 (Debian 11.2-1.pgdg90+1))
Type "help" for help.
postgres=#
To enable https with LetsEncrypt::
config/nginx/nginx.conf
WEBGIS_PUBLIC_HOSTNAME
environment variable within the .env
and config/nginx/nginx.conf
filessudo make renew-ssl
sudo crontab -e
and add the following line:
0 3 * * * /<path_to_your_docker_files>/run_certbot.sh
Docker compose will usually download images from: https://hub.docker.com/u/g3wsuite
A custom (local) docker image for the suite can be created with:
docker build -f Dockerfile.g3wsuite.dockerfile -t g3wsuite/g3w-suite:dev --no-cache .
# OPTIONAL:
# docker build -f Dockerfile.g3wsuite-deps.ltr.dockerfile -t g3wsuite/g3w-suite-deps-ltr:dev --no-cache .
The image is build on latest Ubuntu and QGIS LTR, following this execution order:
config/g3w-suite/overrides/templates
→ a Docker service restart is required to make the changes effective.config/g3w-suite/settings_docker.py
→ a Docker service restart is required to make the changes effective.config/g3w-suite/overrides/static/style.css
→ changes are effective immediatelyDistance
1.2
and check Enable provider simplification if available
0 */1 * * * docker exec g3w-suite-docker_g3w-suite_1 python3 /code/g3w-admin/manage.py check_features_locked
Portainer (https://www.portainer.io) is a docker-based web application used to edit and manage Docker applications in a simple and intuitive way.
Plese refer to the Add new stack section to learn how to deploy the docker-compose-consumer.yml
stack with Portainer (>= v2.1.1).
# NB:
# • (ENV = dev) → docker-compose-dev.yml
# • (ENV = prod) → docker-compose.yml
# • (ENV = consumer) → docker-compose-consumer.yml
docker compose up -f docker-compose.yml up -d
make backup-db ID=foo-backup ENV=prod
make restore-db ID=foo-backup ENV=prod