Giter VIP home page Giter VIP logo

mapproxy-docker's Introduction

mapproxy-docker

GitHub license GitHub release Docker Pulls

TL;DR

docker build -t pdok/mapproxy .
docker run --rm -d -p 8080:80 --name mapproxy-example -v `pwd`/examples/config/mapproxy.yaml:/srv/mapproxy/config/mapproxy.yaml pdok/mapproxy

docker stop mapproxy-example

Introduction

This project aims to fulfill the need for creating a Docker base image that can be used in a scalable infrastructure like Kubernetes and still is easy to use with a single docker run command. That's why we created this docker images containing in which we don't COPY config during the docker build.

What will it do

In it simplist form it will create an Mapproxy application that is easy to use. The only thing required is to add you own mapproxy.yaml configuration. For more complex deployments like docker-compose and/or kubernetes it will provide a starting point in creating multi-container/pods deployments.

Usage

Build

docker build -t pdok/mapproxy .

Run

This image can be run straight from the commandline. The mapproxy config file needs to be mounted on the container path /srv/mapproxy/config/mapproxy.yaml.

docker run -d -p 80:80 --name mapproxy-example -v `pwd`/examples/config/mapproxy.yaml:/srv/mapproxy/config/mapproxy.yaml pdok/mapproxy

Running the example above will start a empty mapproxy. On the url http://localhost:8080/mapproxy/demo the test page can be accessed. Replacing the example mapproxy.yaml with your own will start a mapproxy with that configuration.

This docker image uses lighttpd as a proxy. It's possible to add additional lighttpd config by mounting a include.conf file on the container path /srv/mapproxy/config/include.conf. It's also possible to provide your own complete lighttpd config by mounting a lighttpd.conf file on the container path /srv/mapproxy/config/lighttpd.conf.

Environment variables

DEBUG Set the log level for both lighttpd and mapproxy to debug. This results is verbose logging which includes in request logging (Default: 0)

MIN_PROCS Sets the minimum fastcgi processes to start (Default: 4)

MAX_PROCS Upper limit of fastcgi processes to start (Default: 8)

MAX_LOAD_PER_PROC Maximum number of waiting processes on average per process before a new process is spawned (Default: 1)

IDLE_TIMEOUT Number of seconds before a unused process gets terminated (Default: 20)

Docker-compose

The docker-compose example file can be found here.

Kubernetes

The kubernetes example deployment can be found here.

mapproxy-docker's People

Contributors

boazhuisman avatar gerdos82 avatar kad-jagtt avatar rkettelerij avatar roelarents avatar woutervisscher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mapproxy-docker's Issues

"App failed to load"

On running the container, it stops. Docker logs:

[2019-12-09 15:25:30 +0000] [6] [INFO] Starting gunicorn 20.0.4
[2019-12-09 15:25:30 +0000] [6] [INFO] Listening at: http://0.0.0.0:80 (6)
[2019-12-09 15:25:30 +0000] [6] [INFO] Using worker: gthread
[2019-12-09 15:25:30 +0000] [9] [INFO] Booting worker with pid: 9
Failed to find attribute 'application' in 'config'.
[2019-12-09 15:25:30 +0000] [9] [INFO] Worker exiting (pid: 9)
[2019-12-09 15:25:30 +0000] [6] [INFO] Shutting down: Master
[2019-12-09 15:25:30 +0000] [6] [INFO] Reason: App failed to load.

Possibly related to: https://stackoverflow.com/questions/33379287/gunicorn-cant-find-app-when-name-changed-from-application

Container contains two Python versions

Currently, the container will contain at least two different versions of Python.

You're starting off python:3.7-slim-buster container, which doesn't contain a Debian managed Python 3. Since you're installing python-* instead of python3-*, apt pulls Python 2 packages and its runtime.

Even when forcing the installation of python3-* packages, apt doesn't recognize the manually installed Python 3 from the container image and it will additionally install the maintained one.

Better start off debian:buster-slim - this will save the space of the never used runtimes from python:3.7-slim-buster

unnecessary (duplicate) packages

You're currently mixing the distribution's Python packages with the PIP ones:

  • python3-pil = Pillow (needs some libraries as dependencies)
  • python3-yaml = PyYAML
  • python3-shapely = Shapely
  • Also, neither python3-virtualenv isn't needed, nor eventlet gunicorn is.

Installing the distro's packages make it easier to get all the dependencies, but I think they are better ways in Debian.

I'll try to fix it and send you a PR in return for your good work so far.

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.