Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Share common docker-compose.yml configurations (PROD and DEV enviroments) #79

Draft
wants to merge 10 commits into
base: dev
Choose a base branch
from
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ G3WSUITE_POSTGRES_DBNAME=g3wsuite
G3WSUITE_POSTGRES_HOST=postgis
G3WSUITE_POSTGRES_PORT=5432

G3WSUITE_RUN_HUEY=False

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

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ If all went well, G3W-SUITE run on http://localhost:8080
![Login Page](docs/img/login_page.png)

## G3W-SUITE with consumer image
G3W-SUITE use `huey` for bach processing (https://github.com/coleifer/huey), so if you want to use it,
use `docker-compose-consumer.yml` file on deploy:
G3W-SUITE use `huey` for batch processing (https://github.com/coleifer/huey), so if you want to use it,
set `G3WSUITE_RUN_HUEY=True` enviroment variable and then deploy as usual:
Copy link
Collaborator Author

@Raruto Raruto Sep 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rewrite this in a better English

```bash
docker-compose -f docker-compose-consumer.yml up -d
docker-compose -f docker-compose.yml up -d
```

## Builds
Expand Down Expand Up @@ -203,7 +203,7 @@ postgres=#

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](https://docs.portainer.io/v/ce-2.9/user/docker/stacks/add) section to learn how to deploy the `docker-compose-consumer.yml` stack with Portainer (>= v2.1.1).
Plese refer to the [Add new stack](https://docs.portainer.io/v/ce-2.9/user/docker/stacks/add) section to learn how to deploy the `docker-compose.yml` stack with Portainer (>= v2.1.1).

### Contributors
* Walter Lorenzetti - Gis3W ([@wlorenzetti](https://github.com/wlorenzetti))
Expand Down
2 changes: 1 addition & 1 deletion README_DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ Follow instructions are for development environment.
* set `G3WSUITE_DEBUG` to `True`;
* set `G3WSUITE_LOCAL_CODE_PATH` with path to your local G3W-SUITE code location.

2. Run `docker compose -f docker-compose-dev.yml up -d`.
2. Run `docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d`.
1. If all went well G3W-SUITE is running in development mode on http://127.0.0.1:8000
157 changes: 0 additions & 157 deletions docker-compose-consumer.yml

This file was deleted.

86 changes: 26 additions & 60 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -1,82 +1,48 @@
version: "3"
## HOW TO RUN: ##
#
# docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d
#
version: "3.4"
services:

postgis:
image: g3wsuite/postgis:11.0-2.5
ports:
- "5439:5432"
environment:
- POSTGRES_DBNAME=${G3WSUITE_POSTGRES_DBNAME},data_testing,data_production
- POSTGRES_USER=${G3WSUITE_POSTGRES_USER_LOCAL}
- POSTGRES_PASS=${G3WSUITE_POSTGRES_PASS}
- ALLOW_IP_RANGE=0.0.0.0/0
restart: "no"
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"
restart: "no" # disable autorestart
volumes:
- g3wsuite-pg-data:/var/lib/postgresql
healthcheck:
interval: 60s
timeout: 30s
retries: 3
test: "pg_isready"
networks:
internal:
aliases:
- ${WEBGIS_PUBLIC_HOSTNAME}


g3w-suite:
image: g3wsuite/g3w-suite:dev
environment:
- G3WSUITE_TILECACHE_PATH
- BITBUCKET_TOKEN
- G3WSUITE_DEBUG=${G3WSUITE_DEBUG:-True}
- G3WSUITE_GUNICORN_NUM_WORKERS=${G3WSUITE_GUNICORN_NUM_WORKERS:-1}
- G3WSUITE_QDJANGO_SERVER_URL
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if the G3WSUITE_QDJANGO_SERVER_URL variable is still in use nowadays, currently it doesn't seem to have any production purpose (just forgotten to delete that also inside the docker-compose-dev.yml?)

- 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
- G3WSUITE_DEBUG
- TILESTACHE_CACHE_BUFFER_SIZE
- TILESTACHE_CACHE_TOKEN
- G3WSUITE_GUNICORN_NUM_WORKERS
- G3WSUITE_GUNICORN_MAX_REQUESTS
- G3WSUITE_GUNICORN_TIMEOUT
- FRONTEND
- PGSERVICEFILE
- QGIS_OPTIONS_PATH=/shared-volume/
- QGIS_SERVER_LOG_FILE
- QGIS_SERVER_LOG_LEVEL
expose:
- "8000"
ports:
- "8000:8000"
restart: "no"
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "10"

restart: "no" # disable autorestart
volumes:
- ${WEBGIS_DOCKER_SHARED_VOLUME}:/shared-volume
- ${WEBGIS_DOCKER_SHARED_VOLUME}/node_modules:/code/node_modules
- ./config/g3w-suite/overrides/static:/code/static:ro
- ./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
- ./config/qgis/QGIS3.ini:/shared-volume/QGIS/QGIS3.ini
entrypoint: /scripts/docker-entrypoint.sh

entrypoint: /scripts/docker-entrypoint-dev.sh
redis:
deploy:
replicas: 0 # disable redis service

networks:
internal:
nginx:
deploy:
replicas: 0 # disable nginx service

certbot:
deploy:
replicas: 0 # disable certbot service

g3w-suite-consumer:
deploy:
replicas: 0 # disable huey service

volumes:
shared-volume:
Expand Down
Loading