GithubHelp home page GithubHelp logo

evandrododo / docker-qgis-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kartoza/docker-qgis-server

0.0 3.0 0.0 3.34 MB

A dockerfile that contains a running QGIS server

Shell 35.80% QML 64.20%

docker-qgis-server's Introduction

QGIS Server for Docker

A simple docker container that runs QGIS Server

This image uses the QGIS Desktop docker image as its base.

Please see the canonical documentation for QGIS Server if you need more general info on how QGIS Server works.

Note You should revise the security etc. of this implementation before using in a production environment.

License

GPL V2

QGIS Server documentation

Please see the canonical documentation for QGIS Server if you need more general info on how QGIS Server works.

Usage

To use the image, either pull the latest trusted build from https://registry.hub.docker.com/u/kartoza/qgis-server/ by doing this:

docker pull kartoza/qgis-server:LTR

Note that the LTR build will always track the most recent QGIS Long Term Release build.

We use versioned images and highly recommend that you track a specific version for your orchestrated services since things may break between versions.

In this repository you will find a subdirectory for each QGIS version supported. Each directory contains a self contained docker project and we will maintain all the versioned builds from these containers.

You can build the image yourself like this:

git clone git://github.com/kartoza/docker-qgis-server
cd docker-qgis-server/2.14
docker build -t kartoza/qgis-server .

To run a container do:

docker run --name "qgis-server" -p 9999:80 -d -t kartoza/qgis-server

NOTE: Again we would like to recommend you run a tagged version rather than just the latest since your configuration may break if we change something.

Example use with docker compose

Here is a contrived example showing how you can run QGIS Server from in a docker container using docker-compose. Example docker-compose follows:

db:
  image: kartoza/postgis:9.4-2.1
  environment:
    - USERNAME=docker
    - PASS=docker

qgisserver:
  image: kartoza/qgis-server:2.18.10
  hostname: qgis-server
  volumes:
    # Wherever you want to mount your data from
    - ./web:/web
  links:
    - db:db
  ports:
    - "80801:80"

To run the example do:

docker-compose up

You should see QGIS server start up. For more detailed approaches to using and building the QGIS Server container, see below.

Note: The database in the above example is stateless (it will be deleted when running docker-compose rm). If you want to connect to the PG database from docker use the following info:

  • host: db
  • database: gis
  • user: docker
  • password: docker

Apache environment variables

Apache will make of the following environment variables. You can tweak these by replacing these options in your docker-compose.yml or docker run command.

APACHE_CONFDIR /etc/apache2
APACHE_ENVVARS $APACHE_CONFDIR/envvars
APACHE_RUN_USER www-data
APACHE_RUN_GROUP www-data
APACHE_RUN_DIR /var/run/apache2
APACHE_PID_FILE $APACHE_RUN_DIR/apache2.pid
APACHE_LOCK_DIR /var/lock/apache2
APACHE_LOG_DIR /var/log/apache2
LANG C

The following variables (with defaults shown) are QGIS specific options you can tweak by replacing these options in your docker-compose.yml or docker run command.

QGIS_DEBUG 5
QGIS_LOG_FILE /proc/self/fd/1
QGIS_SERVER_LOG_FILE /proc/self/fd/1
QGIS_SERVER_LOG_LEVEL 5
PGSERVICEFILE /project/pg_service.conf
QGIS_PROJECT_FILE /project/project.qgs
QGIS_PLUGINPATH /opt/qgis-server/plugins

Probably you will want to mount the /project folder with local volume that contains some QGIS projects. As you can see above, if no project file is specified, QGIS will try to serve up /projects/project.qgs by default so if you are looking for an easy to share WMS/WFS url, simply call your project file project.qgs and mount it in the /project directory.

./build.sh; docker kill server; docker rm server;
docker run --name="qgis-server" \
    -d -p 9999:80 \
    kartoza/qgis-server:LTR
 docker logs qgis-server

Replace <path_to_local_qgis_project_folder> with an absolute path on your filesystem. That folder should contain the .qgs project files you want to publish and all the data should be relative to the project files and within the mounted volume. See https://github.com/kartoza/maps.kartoza.com for an example of a project layout that we use to power http://maps.kartoza.com

An example project folder is provided here for convenience (and we use it for validation testing).

Accessing the services:

Simply entering the URL of the docker container with its port number will respond with a valid OGC response if you use this url in QGIS 'add WMS layer' dialog.

http://192.168.99.101:9999/


Authors:

Tim Sutton ([email protected]) - May 2014

Acknowledgement:

During the Girona QGIS hackfest in 2016, Patrick Valsecchi did an almost complete re-write of this image recipe which I have heavily based this and the recipe in docker-qgis-desktop on. Thanks Patrick!

docker-qgis-server's People

Contributors

gustry avatar jancelin avatar lucernae avatar rduivenvoorde avatar timlinux avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.