[GeoNode-users] GeoNode Docker Start Containers

Julierme Pinheiro juliermeopensourcedeveloper at gmail.com
Mon Jul 30 15:24:37 PDT 2018


Actually, all changes can be done through the setting.py. And
local_settings.py has not been used, am I correct?


On Mon, Jul 30, 2018 at 7:16 PM, Julierme Pinheiro <
juliermeopensourcedeveloper at gmail.com> wrote:

> Dear Francesco and Alessio,
>
> Thank you very much for your reply. I removed geonode directory and I
> cloned a new geonode.git. Now I have brand new Docker GeoNode running.
>
> My goal is to configure settings.py and local_settings.py as follow:
>
> 1 - Set SITE_HOST and SITE_HOST_PORT
>
> 1 - Set ALLOWED_HOST and PROXY_ALLOWED_HOST
>
> 2 - Set ACCOUNT E-MAILS
>
> In order to achieve my goal, I did the following:
>
> 1 - # I stopped all containers
>
> $ docker stop nginx4geonode django4geonode geoserver4geonode
> celery4geonode db4geonode rabbitmq4geonode
>
> 2 - # I made a copy of local_settings.py.geoserver.sample as
> local_settings.py and a copy of settings.py as settings.py.copy
>
>
> 3 - Before running <docker-compose up -d>, I changed django.env setting
> GEONODE_LB_HOST_IP=198.162.0.2 and GEONODE_LB_PORT=80
>
> The site is responding in http://198.162.0.2. I think SITE_HOST and
> SITE_HOST_PORT configuration is achieved.
>
> 4 - Changing settings.py
>
> 4.1 - Changing PROXY_ALLOWED_HOSTS
>
> I added the IP 198.162.0.2  to PROXY_ALLOWED_HOSTS = ['localhost',
> 'django', 'geonode', '192.168.0.2' ], but django.env also has
> PROXY_ALLOWED_HOST and changed it ALLOWED_HOSTS = ['localhost', 'django',
> 'geonode', '192.168.0.2' ]
>
> I got confused here. Should I add the IP only into django.env or should I
> add it to settings.py too? Or should I add it only to seetings.py?
>
> 4.2 settings.py  EMAIL CONFIG
>
> # Define email service on GeoNode
> EMAIL_ENABLE = strtobool(os.getenv('EMAIL_ENABLE', 'True'))
>
> if EMAIL_ENABLE:
>     EMAIL_BACKEND = os.getenv('DJANGO_EMAIL_BACKEND',
>                               default='django.core.mail.
> backends.smtp.EmailBackend')
>     EMAIL_HOST = 'smtp.sipa.edu'
>     EMAIL_PORT = 587
>     EMAIL_HOST_USER = 'osgeo.geonode'
>     EMAIL_HOST_PASSWORD = 'passwd
>     EMAIL_USE_TLS = True
>     DEFAULT_FROM_EMAIL = 'osgeo.geonode at sipa.edu'
> else:
>     EMAIL_BACKEND = os.getenv('DJANGO_EMAIL_BACKEND',
>                               default='django.core.mail.
> backends.console.EmailBackend')
>
>
>
> ACCOUNT_OPEN_SIGNUP = True
> ACCOUNT_APPROVAL_REQUIRED = strtobool(
>     os.getenv('ACCOUNT_APPROVAL_REQUIRED', 'True')
> )
> ACCOUNT_ADAPTER = 'geonode.people.adapters.LocalAccountAdapter'
> ACCOUNT_CONFIRM_EMAIL_ON_GET = True
> ACCOUNT_EMAIL_REQUIRED = True
> ACCOUNT_EMAIL_VERIFICATION = True
> ACCOUNT_EMAIL_CONFIRMATION_EMAIL = True
> ACCOUNT_EMAIL_CONFIRMATION_REQUIRED = True
>
>
>
> 4.3 settings.py  SITEURL CONFIG
>
> I got confused in here. As I mentioned in item 3, django.env is set as
> GEONODE_LB_HOST_IP=198.162.0.2 and GEONODE_LB_PORT=80. Though SITEURL =
> os.getenv('SITEURL', "http://localhost:8000/") in the seetings.py, do I
> still have to change it to http://198.162.0.2?
>
>
>
> 5 - Changing local_settings.py
>
> 5.1 - SITEURL CONFIG
>
> I got confused in here. SITEURL is set as SITEURL = "http://localhost/"
> in local_settings, but I set GEONODE_LB_HOST_IP=198.162.0.2 and
> GEONODE_LB_PORT=80 in django.env. Do I still have to change SITEURL to
> SITEURL = "http://198.162.0.2/" in local_settings? Does it make sense to
> have the local_settings.py? Or should I use only settings.py? There was not
> local_settings.py.sample as used to be for Python virtualenv setup, but I
> copied local_settings.py.geoserver.sample as local_settings.py.
>
> 5.2 ALLOWED_HOSTS
>
> I set ALLOWED_HOSTS = [HOSTNAME, 'localhost', '198.162.0.2']. The file
> django.env does no have settings to ALLOWED_HOSTS, therefore, I think I
> have to keep it in local_settings. Am I right?
>
> Could you please give me some insights for the points I got confused?
>
> I appreciated your time in advance
>
> Kind Regards
>
> Julierme
>
>
>
>
>
>
>
>
>
>
> On Mon, Jul 30, 2018 at 5:16 AM, francesco bartoli <xbartolone at gmail.com>
> wrote:
>
>> Can you kindly describe a little bit what your are trying to do and also
>> share the docker-compose file that it is supposed to run?
>>
>> Il giorno ven 27 lug 2018 alle ore 19:30 Julierme Pinheiro <
>> juliermeopensourcedeveloper at gmail.com> ha scritto:
>>
>>> Dear GeoNode Users,
>>>
>>> I am stopping/Starting  the containers nginx4geonode and
>>> geoserver4geonode  to make changes in the settings and local_settings.py in
>>> ~/geoode/geonode/*.
>>>
>>> Everything was working fine, but now I am facing a issue:
>>>
>>> django4geonode container won't start-up. <docker ps> always return:
>>>
>>> STATUS Up 5 seconds and most of the time STATUS Restarting (1) 31
>>> seconds ago.  It is taking hours and django4geonode does not start.
>>>
>>> Sorry for my lack of knowledge on using docker, but my attempt was to
>>> stop and start the container, and it never gets started.
>>>
>>> Even with the restarting process, the response in the browser is *502
>>> Bad Gateway* / nginx/1.15.0.
>>>
>>> Does anyone have face something similar and could give me a hint on this
>>> issue?
>>>
>>> nginx4geonode and geoserver4geonode starts, only django4geonode won't
>>> start-up.
>>>
>>> Thank you very much for your time in advance.
>>>
>>> I appreciated your help
>>>
>>> Kind regards
>>>
>>> Julierme
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> geonode-users mailing list
>>> geonode-users at lists.osgeo.org
>>> https://lists.osgeo.org/mailman/listinfo/geonode-users
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20180730/66e529fb/attachment-0001.html>


More information about the geonode-users mailing list