Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f8372ff
commit 1feb5a4
Showing
5 changed files
with
146 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
mapproxy/ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Created by .ignore support plugin (hsz.mobi) | ||
|
||
mapproxy/ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
FROM python:2.7 | ||
MAINTAINER Arne Schubert<atd.schubert@gmail.com> | ||
|
||
ENV MAPPROXY_VERSION 1.9.1 | ||
ENV MAPPROXY_PROCESSES 4 | ||
ENV MAPPROXY_THREADS 2 | ||
|
||
RUN set -x \ | ||
&& apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ | ||
python-imaging \ | ||
python-yaml \ | ||
libproj0 \ | ||
libgeos-dev \ | ||
python-lxml \ | ||
libgdal-dev \ | ||
build-essential \ | ||
python-dev \ | ||
libjpeg-dev \ | ||
zlib1g-dev \ | ||
libfreetype6-dev \ | ||
python-virtualenv \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& useradd -ms /bin/bash mapproxy \ | ||
&& mkdir -p /mapproxy \ | ||
&& chown mapproxy /mapproxy \ | ||
&& pip install Shapely Pillow uwsgi MapProxy==$MAPPROXY_VERSION \ | ||
&& mkdir -p /docker-entrypoint-initmapproxy.d | ||
|
||
COPY docker-entrypoint.sh / | ||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
CMD ["mapproxy"] | ||
|
||
USER mapproxy | ||
VOLUME ["/mapproxy"] | ||
EXPOSE 8080 | ||
EXPOSE 9191 # Stats |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,71 @@ | ||
# docker-mapproxy | ||
Docker files for mapproxy container | ||
# Mapproxy for Docker | ||
|
||
MapProxy docker image from the [YAGA Development-Team](https://yagajs.org) | ||
|
||
## Supported tags | ||
|
||
* `1.9.1`, `latest` | ||
* `1.9.0` | ||
* `1.8.2` | ||
* `1.8.1` | ||
* `1.8.0` | ||
* `1.7.1` | ||
* `1.7.0` | ||
* `1.6.0` | ||
* `1.5.0` | ||
* `1.4.0` | ||
* `1.3.0` | ||
* `1.2.1` | ||
* `1.2.0` | ||
* `1.1.2` | ||
* `1.1.1` | ||
* `1.1.0` | ||
* `1.0.1` | ||
* `1.0.0` | ||
|
||
## What is MapProxy | ||
|
||
[MapProxy](https://mapproxy.org/) is an open source proxy for geospatial data. It caches, accelerates and transforms | ||
data from existing map services and serves any desktop or web GIS client. | ||
|
||
## Run container | ||
|
||
You can run the container with a command like this: | ||
|
||
```bash | ||
docker run -v /path/to/mapproxy:/mapproxy -p 8080:8080 yagajs/mapproxy | ||
``` | ||
|
||
*It is optional, but recommended to add a volume. Within the volume mapproxy get the configuration, or create one | ||
automatically. Cached tiles will be stored also into this volume.* | ||
|
||
The container normally runs in [http-socket-mode](http://uwsgi-docs.readthedocs.io/en/latest/HTTP.html). If you will not | ||
run the image behind a HTTP-Proxy, like [Nginx](http://nginx.org/), you can run it in direct http-mode by running: | ||
|
||
```bash | ||
docker run -v /path/to/mapproxy:/mapproxy -p 8080:8080 yagajs/mapproxy mapproxy http | ||
``` | ||
|
||
### Environment variables | ||
|
||
* `MAPPROXY_PROCESSES` default: 4 | ||
* `MAPPROXY_THREADS` default: 2 | ||
|
||
## Enhance the image | ||
|
||
You can put a `mapproxy.yaml` into the `/docker-entrypoint-initmapproxy.d` folder on the image. On startup this will be | ||
used as MapProxy configuration. Attention, this will override an existing configuration in the volume! | ||
|
||
Additional you can put shell-scripts, with `.sh`-suffix in that folder. They get executed on container startup. | ||
|
||
You should use the `mapproxy` user within the container, especially not `root`! | ||
|
||
## Contributing | ||
|
||
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull | ||
requests, and do our best to process them as fast as we can. | ||
|
||
Before you start to code, we recommend discussing your plans through a | ||
[GitHub issue](https://github.com/yagajs/docker-mapproxy/issues), especially for more ambitious contributions. | ||
This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help | ||
you find out if someone else is working on the same thing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
if [ "$1" = 'mapproxy' ]; then | ||
echo "Running additional provisioning" | ||
for f in /docker-entrypoint-initmapproxy.d/*; do | ||
case "$f" in | ||
*.sh) echo "$0: running $f"; . "$f" ;; | ||
mapproxy.yml) cp /docker-entrypoint-initmapproxy.d/mapproxy.yml /mapproxy/mapproxy.yaml ;; | ||
mapproxy.yaml) cp /docker-entrypoint-initmapproxy.d/mapproxy.yaml /mapproxy/mapproxy.yaml ;; | ||
esac | ||
echo | ||
done | ||
|
||
if [ ! -f /mapproxy/mapproxy.yaml ] ;then | ||
mapproxy-util create -t base-config /mapproxy/ | ||
fi | ||
if [ ! -f /mapproxy/app.py ] ;then | ||
mapproxy-util create -t wsgi-app -f /mapproxy/mapproxy.yaml /mapproxy/app.py | ||
fi | ||
echo "Start mapproxy" | ||
|
||
if [ "$2" = 'http' ]; then | ||
exec uwsgi --http 0.0.0.0:8080 --wsgi-file /mapproxy/app.py --master --enable-threads --processes $MAPPROXY_PROCESSES --threads $MAPPROXY_THREADS --stats 0.0.0.0:9191 | ||
exit | ||
fi | ||
|
||
exec uwsgi --http-socket 0.0.0.0:8080 --wsgi-file /mapproxy/app.py --master --enable-threads --processes $MAPPROXY_PROCESSES --threads $MAPPROXY_THREADS --stats 0.0.0.0:9191 | ||
exit | ||
fi | ||
|
||
exec "$@" |