-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Kustomize definitions (logging, generatorOptions), update README.
- Loading branch information
Showing
6 changed files
with
116 additions
and
20 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 |
---|---|---|
@@ -1,34 +1,58 @@ | ||
MapProxy service application | ||
============================ | ||
# MapProxy service application | ||
|
||
Basic MapProxy service used internally by the Department of Biodiversity, | ||
Conservation and Attractions. | ||
|
||
# Docker image | ||
## Development | ||
|
||
To build a new Docker image from the `Dockerfile`: | ||
Development of the containerised application is based on the | ||
installation instructions in the MapProxy documentation: | ||
<https://mapproxy.github.io/mapproxy/latest/install.html> | ||
|
||
docker image build -t ghcr.io/dbca-wa/mapproxy . | ||
Additional reference can be made to the GitHub project Dockerfile: | ||
<https://github.com/mapproxy/mapproxy/blob/master/docker/Dockerfile> | ||
|
||
# Running Docker container | ||
The recommended way to set up this project for development is using | ||
[Poetry](https://python-poetry.org/docs/) to install and manage a virtual Python | ||
environment. With Poetry installed, change into the project directory and run: | ||
|
||
When running this image as a container, provide a configuration file | ||
mounted at `/app/config/mapproxy.yaml` (this can be a bind-mounted | ||
local file or a ConfigMap in Kubernetes). | ||
poetry install | ||
|
||
Example using a local bind-mount file: | ||
Activate the virtualenv like so: | ||
|
||
docker container run -p 8080:8080 -v $PWD/mapproxy.yaml:/app/config/mapproxy.yaml ghcr.io/dbca-wa/mapproxy | ||
poetry shell | ||
|
||
# Development | ||
To run Python commands in the activated virtualenv, thereafter run them like so: | ||
|
||
Development of the containerised application is based on the | ||
installation instructions in the MapProxy documentation: | ||
https://mapproxy.github.io/mapproxy/latest/install.html | ||
gunicorn --config gunicorn.py wsgi | ||
|
||
Additional reference can be made to the GitHub project Dockerfile: | ||
https://github.com/mapproxy/mapproxy/blob/master/docker/Dockerfile | ||
Manage new or updating project dependencies with Poetry also, like so: | ||
|
||
poetry add newpackage==1.0 | ||
|
||
## MapProxy configuration | ||
|
||
To configure the local MapProxy server, create a `config` directory in the project directory | ||
(relative to `wsgi.py`) and create the following configuration files in there: | ||
|
||
- mapproxy.yaml | ||
- logging.ini | ||
- seed.yaml (optional) | ||
|
||
MapProxy configuration reference: <https://mapproxy.github.io/mapproxy/latest/configuration.html> | ||
|
||
## Docker image | ||
|
||
To build a new Docker image from the `Dockerfile`: | ||
|
||
docker image build -t ghcr.io/dbca-wa/mapproxy . | ||
|
||
## Running Docker container | ||
|
||
When running this image as a container, provide a configuration file | ||
mounted at `/app/config/mapproxy.yaml` (this can be a bind-mounted | ||
local file or a ConfigMap in Kubernetes). | ||
|
||
# MapProxy configuration | ||
Example using local configuration files bind-mounted into the container: | ||
|
||
Reference: https://mapproxy.github.io/mapproxy/latest/configuration.html | ||
docker container run -p 8080:8080 -v $PWD/config/mapproxy.yaml:/app/config/mapproxy.yaml -v $PWD/config/logging.ini:/app/config/logging.ini ghcr.io/dbca-wa/mapproxy |
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
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,33 @@ | ||
[loggers] | ||
keys=root,source_requests | ||
|
||
[handlers] | ||
keys=mapproxy,source_requests | ||
|
||
[formatters] | ||
keys=default,requests | ||
|
||
[logger_root] | ||
level=INFO | ||
handlers=mapproxy | ||
|
||
[logger_source_requests] | ||
level=INFO | ||
qualname=mapproxy.source.request | ||
# propagate=0 -> do not show up in logger_root | ||
propagate=0 | ||
handlers=source_requests | ||
|
||
[handler_mapproxy] | ||
class=StreamHandler | ||
formatter=default | ||
|
||
[handler_source_requests] | ||
class=StreamHandler | ||
formatter=requests | ||
|
||
[formatter_default] | ||
format=%(asctime)s - %(levelname)s - %(name)s - %(message)s | ||
|
||
[formatter_requests] | ||
format=[%(asctime)s] %(message)s |
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
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,33 @@ | ||
[loggers] | ||
keys=root,source_requests | ||
|
||
[handlers] | ||
keys=mapproxy,source_requests | ||
|
||
[formatters] | ||
keys=default,requests | ||
|
||
[logger_root] | ||
level=INFO | ||
handlers=mapproxy | ||
|
||
[logger_source_requests] | ||
level=INFO | ||
qualname=mapproxy.source.request | ||
# propagate=0 -> do not show up in logger_root | ||
propagate=0 | ||
handlers=source_requests | ||
|
||
[handler_mapproxy] | ||
class=StreamHandler | ||
formatter=default | ||
|
||
[handler_source_requests] | ||
class=StreamHandler | ||
formatter=requests | ||
|
||
[formatter_default] | ||
format=%(asctime)s - %(levelname)s - %(name)s - %(message)s | ||
|
||
[formatter_requests] | ||
format=[%(asctime)s] %(message)s |
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