Giter Club home page Giter Club logo

aws-ecr-ecs-flask-viewpics's Introduction

aws-ecr-ecs-flask-viewpics 🐳

Stars Issues Forks Report an issue

detail

reference

  1. youtube
  2. github

deploy local

  • note: Dockerfile > FROM python:3.9 -> ⚠️WARNING⚠️ will ERR if python ver later than 3.9!!! ⚠️WARNING⚠️
docker build -t test .
docker run -d --publish 8888:5000 test
docker ps
CONTAINER ID   IMAGE     COMMAND             CREATED         STATUS         PORTS                                       NAMES
a6eea6eec475   test      "python ./app.py"   4 seconds ago   Up 2 seconds   0.0.0.0:8888->5000/tcp, :::8888->5000/tcp   nice_wozniak
  • access localhost:8888 on browser will see random cat pictures in app.py > images = [...]

ecr

aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin ACCOUNTIDHERE!!!.dkr.ecr.us-east-1.amazonaws.com
Login Succeeded
  • create repo ecr-test
docker tag test:latest ACCOUNTIDHERE!!!.dkr.ecr.us-east-1.amazonaws.com/ecr-test:latest
docker push ACCOUNTIDHERE!!!.dkr.ecr.us-east-1.amazonaws.com/ecr-test:latest

ecr

ecs

create cluster:

  • template=EC2 Linux + Networking
  • cluster name=ECSCatAppCluster
  • EC2 instance type=t3a.micro
  • Subnets=...us-east-1a
  • Auto assign public IP=Enabled
  • Security group=default

create task definition

  • launch type=EC2
  • Task definition name=ECSCatAppDemoTask
  • Task role=None
  • Task memory (MiB) = Task CPU (unit) = 512

add container

  • Container name=CatAppContainer
  • Image=ACCOUNTIDHERE!!!.dkr.ecr.us-east-1.amazonaws.com/ecr-test:latest
  • Port mappings=8888 | 5000

run new task

  • Launch type=EC2
  • final result: ecs map with EC2 ecs

deploy ec2

Security group=default

  • add Inbound rules: TCP + 8888 + 0.0.0.0/0
  • access http://ec2-44-201-20-5.compute-1.amazonaws.com:8888/ on browser will see random cat pictures

aws-ecr-ecs-flask-viewpics's People

Contributors

tquangdo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.