Example

Define an API

# main.py

print("hello world")

Create a Dockerfile

FROM python:3.8-slim

COPY main.py /

CMD exec python main.py

Build an image

docker build . -t hello-world

Run a container locally

docker run -it --rm hello-world

Login to ECR

Create a repository

Tag the image

Push the image

Configure a Cortex deployment

Create a Cortex deployment

Get the API endpoint

Make a request

View the logs

Last updated