g3w-suite / g3w-suite-docker

Run G3W-SUITE stack with docker-compose
https://g3w-suite.readthedocs.io/en/latest/docker.html
30 stars 32 forks source link

Add some info related to `manage.py` (docker exec) #75

Closed Raruto closed 1 year ago

Raruto commented 2 years ago

For admin users it might be quite useful to know how to correctly run the manage.py command (ie. adding the -e DISPLAY=:99 and -w /code/g3w-admin parameters):

docker exec -it -e DISPLAY=:99 -w /code/g3w-admin <CONTAINER ID / NAME> python3 manage.py

Currently (v3.4) the only reference to the DISPLAY environment variable is quite hidden within the editing section:

Editing module is active by default, to avoid simultaneous feature editing by two or more users, the editing module works with a feature lock system. This locking system can remain active if users do not exit the editing state correctly, to avoid this it is advisable to activate a cron job on host machine that checks the features that have been locked for more than 4 hours and frees them:

0 */1 * * * docker exec -e DISPLAY=:99 g3w-suite-docker_g3w-suite_1 python3 /code/g3w-admin/manage.py check_features_locked

Related to: https://github.com/g3w-suite/g3w-client/issues/183

Raruto commented 2 years ago

BTW, the DISPLAY value could also be passed as an environment variable through docker-compose.yml

For example, within the docker-compose-dev.yml:

g3w-suite:
  image: g3wsuite/g3w-suite:dev
  environment:
    - DISPLAY=:99
    - G3WSUITE_TILECACHE_PATH
    ...