Skip to content

Latest commit

 

History

History
62 lines (44 loc) · 1.89 KB

README.md

File metadata and controls

62 lines (44 loc) · 1.89 KB

docker

Some useful docker images for utilizing the ArcGIS API for Python in your workflows

LambdaBaseImage

ghcr.io/esri/arcgis-python-api-lambda:latest

To use this image, setup your dockerfile like:

FROM ghcr.io/esri/arcgis-python-api-lambda:latest
COPY app.py ${LAMBDA_TASK_ROOT}

your app.py should have a handler method:

import arcgis

def handler(event, context):
    """
    AWS Lambda Handler
    """
    print(f"Hello from AWS Lambda using ArcGIS API for Python {arcgis.__version__}!")

Push to your private AWS ECR instance, and configure lambda to run from this container image. As of this writing, public AWS ECR instances are not supported for lambda.

AzureFunctionsBaseImage

ghcr.io/esri/arcgis-python-api-azure-functions:latest

Sample

To use this image, setup your dockerfile like

FROM ghcr.io/esri/arcgis-python-api-azure-functions:latest
COPY . /home/site/wwwroot

Your copied resources will need to include:

  • host.json, with your appsettings
  • function_app.py, such as:
import arcgis
import azure.functions as func

app = func.FunctionApp()

@app.http_trigger(route='GET /', methods=['get'])
def main(req: func.HttpRequest) -> func.HttpResponse:
    return func.HttpResponse(f"Hello from Azure Functions using ArcGIS API for Python {arcgis.__version__}!")

Push to the container registry of your choice.

For futher information, see: