-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dev mode with regular Docker (#4514)
* add env files for dev * Add docker-compose scripts for dev mode * Fix reference links to docs * Align with template link * Avoid clash between django and celery commands * Fix broken links * Align geoserver version in compose file for devel * Remove no longer used variable * Set env_file from root environment variable SET_DOCKER_ENV * Align prod and devel env files * Align filename extension of docker-compose file * Improve cmd logic for development * Use a single file to override for development mode * Add docs for developing with docker * Install ipdb for development
- Loading branch information
1 parent
2073bee
commit f47f752
Showing
22 changed files
with
269 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
COMPOSE_PROJECT_NAME=geonode | ||
SET_DOCKER_ENV=production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
version: '2.2' | ||
services: | ||
|
||
celery: | ||
build: . | ||
command: celery worker --app=geonode.celery_app:app --broker=amqp://guest:guest@rabbitmq:5672/ -B -l DEBUG | ||
depends_on: | ||
- db | ||
- elasticsearch | ||
- rabbitmq | ||
volumes: | ||
- .:/usr/src/app | ||
- statics:/mnt/volumes/statics | ||
- geoserver-data-dir:/geoserver_data/data | ||
environment: | ||
- DOCKER_ENV=${SET_DOCKER_ENV} | ||
- IS_CELERY=True | ||
- DEBUG=True | ||
- GEONODE_LB_HOST_IP=localhost | ||
- GEONODE_LB_PORT=80 | ||
- SITEURL=http://localhost/ | ||
- ALLOWED_HOSTS=['localhost', ] | ||
- GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/ | ||
- GEOSERVER_WEB_UI_LOCATION=http://localhost/geoserver/ | ||
|
||
django: | ||
build: . | ||
command: python manage.py runserver --settings=geonode.settings 0.0.0.0:8000 | ||
volumes: | ||
- .:/usr/src/app | ||
- statics:/mnt/volumes/statics | ||
- geoserver-data-dir:/geoserver_data/data | ||
environment: | ||
- DOCKER_ENV=${SET_DOCKER_ENV} | ||
- IS_CELERY=False | ||
- DEBUG=True | ||
- GEONODE_LB_HOST_IP=localhost | ||
- GEONODE_LB_PORT=80 | ||
- SITEURL=http://localhost/ | ||
- ALLOWED_HOSTS=['localhost', ] | ||
- GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/ | ||
- GEOSERVER_WEB_UI_LOCATION=http://localhost/geoserver/ | ||
|
||
geoserver: | ||
depends_on: | ||
- db | ||
- elasticsearch | ||
- rabbitmq | ||
- data-dir-conf | ||
environment: | ||
- GEONODE_LB_HOST_IP=localhost | ||
- GEONODE_LB_PORT=80 | ||
|
||
geonode: | ||
image: geonode/nginx:${SET_DOCKER_ENV} | ||
restart: unless-stopped | ||
container_name: nginx4${COMPOSE_PROJECT_NAME} | ||
stdin_open: true | ||
# tty: true | ||
labels: | ||
org.geonode.component: nginx | ||
org.geonode.instance.name: geonode | ||
depends_on: | ||
- django | ||
- celery | ||
- geoserver | ||
ports: | ||
- 80:80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,3 @@ services: | |
environment: | ||
- GEONODE_LB_HOST_IP=localhost | ||
- GEONODE_LB_PORT=80 | ||
# - NGINX_BASE_URL= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,3 @@ services: | |
environment: | ||
- GEONODE_LB_HOST_IP=localhost | ||
- GEONODE_LB_PORT=80 | ||
# - NGINX_BASE_URL= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
Start to develop with Docker | ||
---------------------------- | ||
|
||
How to run the instance for development | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Set the variable SET_DOCKER_ENV for development | ||
............................................... | ||
|
||
.. code-block:: shell | ||
vi .env | ||
Change to | ||
|
||
.. code-block:: shell | ||
SET_DOCKER_ENV=development | ||
Use dedicated docker-compose files while developing | ||
................................................... | ||
|
||
.. note:: In this example we are going to keep ``localhost`` as the target IP for GeoNode | ||
|
||
.. code-block:: shell | ||
docker-compose -f docker-compose.async.yml -f docker-compose.development.yml up | ||
How to debug | ||
............ | ||
|
||
.. note:: We are supposing to use ``ipdb`` for debugging which is already available as package from the container | ||
|
||
Stop the container for the ``django`` service: | ||
|
||
.. code-block:: shell | ||
docker-compose stop django | ||
Run the container again with the option for *service ports*: | ||
|
||
.. code-block:: shell | ||
docker-compose run \ | ||
-e DOCKER_ENV=development \ | ||
-e IS_CELERY=False \ | ||
-e DEBUG=True \ | ||
-e GEONODE_LB_HOST_IP=localhost \ | ||
-e GEONODE_LB_PORT=80 \ | ||
-e SITEURL=http://localhost/ \ | ||
-e ALLOWED_HOSTS="['localhost', ]" \ | ||
-e GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/ \ | ||
-e GEOSERVER_WEB_UI_LOCATION=http://localhost/geoserver/ \ | ||
--rm --service-ports django python manage.py runserver --settings=geonode.settings 0.0.0.0:8000 | ||
Access the site on http://localhost/ | ||
|
||
.. note:: If you set an ``ipdb`` debug point with import ``ipdb ; ipdb.set_trace()`` then you should be facing its console and you can see the django server which is restarting at any change of your code from your local machine. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,7 @@ | ||
How to Develop | ||
============== | ||
============== | ||
|
||
.. toctree:: | ||
:maxdepth: 3 | ||
|
||
docker/index |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ipdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
DJANGO_SETTINGS_MODULE=geonode.settings | ||
GEONODE_INSTANCE_NAME=geonode | ||
GEONODE_LB_HOST_IP | ||
GEONODE_LB_PORT | ||
DEFAULT_BACKEND_DATASTORE=datastore | ||
GEONODE_DATABASE=geonode | ||
GEONODE_DATABASE_PASSWORD=geonode | ||
GEONODE_GEODATABASE=geonode_data | ||
GEONODE_GEODATABASE_PASSWORD=geonode_data | ||
ASYNC_SIGNALS=True | ||
BROKER_URL=amqp://guest:guest@rabbitmq:5672 | ||
DOCKER_ENV=development | ||
IS_CELERY=True | ||
DEBUG=True | ||
C_FORCE_ROOT=1 | ||
SITEURL=http://localhost/ | ||
# replaced with defaults in settings | ||
GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/ | ||
GEOSERVER_WEB_UI_LOCATION=http://localhost/geoserver/ | ||
GEOSERVER_LOCATION=http://geoserver:8080/geoserver/ | ||
OGC_REQUEST_TIMEOUT=300 | ||
STATIC_ROOT=/mnt/volumes/statics/static/ | ||
MEDIA_ROOT=/mnt/volumes/statics/uploaded/ | ||
GEOIP_PATH=/mnt/volumes/statics/geoip.db | ||
ALLOWED_HOSTS=['django', '*'] | ||
ADMIN_EMAILS | ||
DEFAULT_BACKEND_UPLOADER=geonode.importer | ||
TIME_ENABLED=True | ||
MOSAIC_ENABLED=False | ||
GEOGIG_ENABLED=False | ||
HAYSTACK_SEARCH=False | ||
HAYSTACK_ENGINE_URL=http://elasticsearch:9200/ | ||
HAYSTACK_ENGINE_INDEX_NAME=haystack | ||
HAYSTACK_SEARCH_RESULTS_PER_PAGE=200 | ||
|
||
|
||
ALLOWED_DOCUMENT_TYPES=['doc', 'docx', 'gif', 'jpg', 'jpeg', 'ods', 'odt', 'odp', 'pdf', 'png','ppt', 'pptx', 'rar', 'sld', 'tif', 'tiff', 'txt', 'xls', 'xlsx', 'xml', 'zip', 'gz', 'qml'] | ||
MAX_DOCUMENT_SIZE=2 | ||
|
||
# GEOSERVER_ADMIN_PASSWORD=admin | ||
# See https://github.com/geosolutions-it/geonode-generic/issues/28 | ||
# to see why we force API version to 1.24 | ||
DOCKER_API_VERSION="1.24" |
Oops, something went wrong.