• Stars
    star
    108
  • Rank 321,259 (Top 7 %)
  • Language
    HTML
  • License
    MIT No Attribution
  • Created over 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Example application for AWS App Runner

Hello App Runner

This is a example web service for AWS App Runner. You can use this repo to automatically build and deploy or use pre-built images at ECR Public.

You can read about AWS App Runner in the launch blog

Deploy to App Runner

If you want to deploy this container make sure you have the latest release of the awscli and run

SERVICE_NAME=hello-app-runner

cat > hello-app-runner.json <<EOF
{
    "ImageRepository": {
        "ImageIdentifier": "public.ecr.aws/aws-containers/hello-app-runner:latest",
        "ImageConfiguration": {
            "Port": "8000"
        },
        "ImageRepositoryType": "ECR_PUBLIC"
    },
    "AutoDeploymentsEnabled": false
}
EOF

aws apprunner create-service --service-name ${SERVICE_NAME} \
    --source-configuration file://hello-app-runner.json

If you want to deploy and manage this container using AWS CloudFormation just run

SERVICE_NAME=hello-app-runner

aws cloudformation create-stack --template-body file://cf.yaml --stack-name ${SERVICE_NAME} --parameters "ParameterKey=ServiceName,ParameterValue=${SERVICE_NAME}"

Features

The service exposes a basic splash page with links to relevant App Runner content. It has two unique features which benefit from running it in App Runner.

Upon first request it generates a unique avatar for each service which is saved in ./static/social.png. This image is used for social preview images when shared online and will be the same across different all of your container instances. It is an example of using a local disk for small assets in an application.

The service also provides a /metrics endpoint so you can see some of the long running metrics of requests coming into the service. This is an example of global state stored on a per container basis. It can be used for state management, in memory cache, or other application needs.

There also might be an easter egg or two if you read the code. ;)

Development

To run this application locally you can use pipenv

pipenv install
pipenv run python app.py

To run the application locally in a container you can use docker

docker build -t hello-app-runner .
docker run -it -p 8000:8000 hello-app-runner

More Repositories

1

amazon-ecs-exec-checker

🚀 Pre-flight checks for ECS Exec
Shell
864
star
2

retail-store-sample-app

Sample application for demonstrating container platforms and related technology
Java
231
star
3

kubectl-detector-for-docker-socket

A Kubectl plugin that can detect if any of your workloads or manifest files are mounting the docker.sock volume
Go
175
star
4

eks-app-mesh-polyglot-demo

End to end deployment and observability of polyglot microservices in Amazon EKS using AWS App Mesh, AWS Fargate, Amazon Cloudwatch Container Insights, and AWS X-Ray
Python
66
star
5

ecs-anywhere-tutorial

Shell
62
star
6

Airflow-on-Fargate

TypeScript
59
star
7

proton-codebuild-provisioning-examples

This repository contains sample IaC templates to demonstrate how to leverage Codebuild provisioning with AWS Proton.
HCL
26
star
8

ecsdemo-platform

Python
24
star
9

ecs-workshop-blue-green-deployments

TypeScript
22
star
10

ecsdemo-nodejs

Python
21
star
11

ecs-task-protection-examples

JavaScript
17
star
12

ecsdemo-crystal

Python
16
star
13

demo-app-for-docker-compose

Python
16
star
14

hello-app-runner-nodejs

Example Next.js application for App Runner with DynamoDB using Copilot CLI
JavaScript
13
star
15

votingapp

Python
12
star
16

appmeshworkshop

CSS
10
star
17

amazon-ecr-public-creds-helper-script-for-k8s

Amazon ECR "Public" credentials helper script for Kubernetes
Shell
9
star
18

aws-lambda-for-the-containers-developer-blog

Shell
9
star
19

apprunnerworkshop

CSS
8
star
20

codepipeline-codebuild-buildpacks-example

5
star
21

ecsdemo-migration-to-ecs

Python
5
star
22

ecsworkshop-efsdemo

Python
3
star
23

hello-eks-anywhere

Example application to deploy to your first EKS Anywhere cluster
Shell
3
star
24

eks-microservice-demo

Canary Deployment using Flagger with App Mesh
JavaScript
3
star
25

stateful-counter

An example stateful application that counts
HTML
3
star
26

ecsworkshop-secrets-demo

JavaScript
2
star
27

impression-counter-api-app-runner-sample

AWS App Runner sample for an API Impression counter with VPC access using VPC Connector, can be deployed with terraform plan
HCL
2
star
28

aws-containers-a2z

Onboard on a long journey into modern application development with AWS Containers Services and more...
JavaScript
1
star
29

ecsdemo-capacityproviders

Python
1
star