edit

Cartoview

Docker

  • be sure you installed all requirements
  • Install Docker
  • For Windows User install make by
    • installing MSYS2
    • open msys shell and install make using this command pacman -S make
    • add <msys_path>\usr\bin to PATH envirnment variable
  • for windows users please use Docker Quickstart Terminal to execute the following commands
  • Create Cartoview Project which contains required files to run and configure Docker using this command:

    1
    django-admin.py startproject --template=https://github.com/cartologic/cartoview-project-template/archive/master.zip --name django.env,uwsgi.ini,.bowerrc,server.py <your_project_name>
    
  • Replace <your_project_name> with the desired name

  • Go to your project Folder

    1
    cd <your_project_name>
    
  • Open docker-compose.yml and Look at the port numbers for GeoServer and Postges and change the number before the : this will be the port on your machine

    Tips

    • any file with .env EXTENSION Is a file that contains environment variables passed to specific container for example django.env file contains environment variables passed to Cartoview container so django can read these variables and use them
    • default database username: cartologic and password: root
    • default database user in postgis.env file in your project if want to change it.
    • If you want to run this project with a domain :
      • change django.env(this is the file of the common django setting variables) file in your Project Folder to be some thing like this:
        1
        2
        3
        4
        5
        DATABASE_URL=postgres://<database_user_name>:<database_password>@postgis:5432/cartoview
        GEOSERVER_PUBLIC_LOCATION=http://<your_domain_or_ip>/geoserver/
        GEOSERVER_LOCATION=http://geoserver:8080/geoserver/
        SITEURL=http://<your_domain_or_ip>
        ALLOWED_HOSTS=['*']
        
    • For windows users the default IP aasigned to docker is : 192.168.99.100 so the default django.env file must be some thing like this:
      1
      2
      3
      4
      5
      DATABASE_URL=postgres://<database_user_name>:<database_password>@postgis:5432/cartoview
      GEOSERVER_PUBLIC_LOCATION=http://192.168.99.100/geoserver/
      GEOSERVER_LOCATION=http://geoserver:8080/geoserver/
      SITEURL=http://192.168.99.100
      ALLOWED_HOSTS=['*']
      

    Warning

    • For windows Users Please Comment volumes lines of postgis Container only in docker-compose.yml by preceding the line with # something like this:
      1
      2
          #   volumes:
          #      - pgdata:/var/lib/postgresql
      
    • if django-admin.py not working try django-admin
  • Start Docker images(cartoview,geoserver,postgres) type :

    1
    make run
    

    Success

    Now you can Access cartoview on http://localhost or http://<your_domain_or_ip>

    Important

    Final step Configure Geoserver before uploading layers from here

Deployment notes

  • Important

    Once CartoView is installed is expected to install all apps from the app store automatically CartoView will not be able to restart docker when new apps install. After you install any new app or app update you will need to restart docker manually until this issue is addressed in the future
    • follow these steps to get apps working on nginx
      • collect static files using this commands in your project folder
        1
        make collect_static
        
      • restart server now with the following command you should restart server after installing any app
        1
        docker-compose restart cartoview
        

Windows Issues

  • Docker volumes have some issues with windows so you have to backup your postgres database.

Docker on Linux

  • you will Find all postgres data in pgdata folder