Skip to content

Commit

Permalink
[Closes #3896] Add a sample docker-compose.override.localhost.yml to …
Browse files Browse the repository at this point in the history
…run docker-compose on localhost (#3897)

* [Closes #ISSUE_3896] Add a sample docker-compose.override.localhost.yml to run docker-compose on localhost

* Add section for docker ip address
  • Loading branch information
Alessio Fabiani committed Sep 7, 2018
1 parent 625d0fa commit 7718cb9
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 6 deletions.
33 changes: 33 additions & 0 deletions docker-compose.override.localhost.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: '2.2'

services:
django:
build: .
# Loading the app is defined here to allow for
# autoreload on changes it is mounted on top of the
# old copy that docker added when creating the image
volumes:
- '.:/usr/src/app'
environment:
- DEBUG=True
- GEONODE_LB_HOST_IP=localhost
- GEONODE_LB_PORT=80
- SITEURL=http://localhost/
- ALLOWED_HOSTS=['localhost', ]
- GEOSERVER_PUBLIC_LOCATION=http://localhost/geoserver/

# celery:
# build: .
# # Loading the app is defined here to allow for
# # autoreload on changes it is mounted on top of the
# # old copy that docker added when creating the image
# volumes:
# - '.:/usr/src/app'
# environment:
# - DEBUG=True

geoserver:
environment:
- GEONODE_LB_HOST_IP=localhost
- GEONODE_LB_PORT=80
# - NGINX_BASE_URL=
2 changes: 1 addition & 1 deletion docs/organizational/contribute/README
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ If you want to use Docker you can now::
docker-compose build

# run the docker container
docker-compose up
docker-compose up -f docker-compose.override.localhost.yml -d

# turn it off
docker-compose down
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,20 @@ Verify the installation::

docker-compose --version

Running GeoNode stack
=====================
Running GeoNode stack on localhost
==================================

Clone the repository::

git clone https://github.com/GeoNode/geonode.git

Launch the stack with the build of GeoNode so any changes you did will be immediately available::

docker-compose up --build

docker-compose up -f docker-compose.override.localhost.yml --build

.. note::
**docker-compose.override.localhost.yml** containse environment variables to allow you run the instances on *localhost*. You can use this file as template in order to run on other public addresses.

.. note::
**For Windows users**: In case you're using the native Docker for Windows (on Hyper-V) you will probably be affected by an error related to mounting the /var/run/docker.sock volume. It's due to a `problem with the current version of Docker Compose <https://github.com/docker/for-win/issues/1829>`_ for Windows.
In this case you need to set the **COMPOSE_CONVERT_WINDOWS_PATHS** environmental variable:
Expand All @@ -52,6 +55,13 @@ Launch the stack with the build of GeoNode so any changes you did will be immedi

before running docker-compose up

Running GeoNode stack on docker ip address
==========================================

If you want to navigate the application from the address of the Docker socket than run simply::

docker-compose up --build

GeoNode will be available at the ip address of the ``docker0`` interface::

ifconfig -a
ifconfig -a

0 comments on commit 7718cb9

Please sign in to comment.