Cloud deployment¶
Deployment to cloud infratructure and concepts such as Microservices and Twelve-Factor present specific requirements to how software is designed and implemented. pygeoapi supports these concepts, having a low footprint on CPU and memory, and does not persist user state, therefore being able to scale without risks.
pygeoapi and Docker¶
A Docker image is available for pygeoapi. You can run the image locally as:
Review the pygeoapi Dockerfile
Notice in the pygeoapi Dockerfile how the open api file is generated as part of the Docker startup script.
In a typical configuration one would override the default pygeoapi configuration file in the image with a customized one and include the data folder:
using custom configuration
Alternatively, you can build a fresh Docker image including both the configuration and data for the service.
You may have noticed that the pygeoapi configuration file includes a reference to the endpoint on which pygeoapi is published. This configuration should match the public endpoint of the service (domain, path and port).
By default the pygeoapi Docker image will run from the root path /. If you need to run from a sub-path and have all internal URLs correct you can
set the SCRIPT_NAME environment variable.
Summary¶
Congratulations! You can now deploy pygeopi as a cloud native service.