GithubHelp home page GithubHelp logo

bctek / cluster-sample-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws-samples/cluster-sample-app

0.0 0.0 0.0 302 KB

A very basic app written in Javascript and packaged as a Docker image to be used as a demo when testing clustered deployments in ECS/EKS.

License: MIT No Attribution

JavaScript 85.70% HTML 7.24% Dockerfile 7.06%

cluster-sample-app's Introduction

Continuous Integration license

Cluster Sample Application

A very basic web application written in Javascript and packaged as a Docker image to be used as a demo when testing clustered deployments.

The application default page displays current date, time as well as the current IP addresses of the current application node.

Preliminary comments

This demo application is not production ready. It is only intended for demo and learning purposes.

The Application Load Balancer created by the CloudFormation template is externally facing and publicly available without any restrictions.

In order to add HTTPS support to this load balancer, you may take the steps described in the following documentation:

Prerequisites

The following are prequisites:

  • an AWS Account
  • Node.js (v14) with npm installed
  • Docker installed

Use the following command to install the project dependencies:

npm install

Creating your ECR repository

To create a private repository for your docker image you can take the following steps:

  1. Navigate to your AWS console and open the ECR service console
  2. Click on "Repositories" and "Create repository"
  3. For the repository name, use "cluster-sample-app"
  4. For all others settings, you can use defaults
  5. You can then click on "Create repository"

Building, tagging and pushing your docker image to your ECR repository

To build, tag and push your docker image, take the following steps:

  1. Navigate to your AWS console and open the ECR service console
  2. Select your repository and click "View push commands"
  3. Use the commands listed to build, tag and push your docker image

Deploying your application stack with CloudFormation

To deploy your application stack using the provided CloudFormation template, take the following step:

  1. Navigate to your AWS console and open the CloudFormation service console
  2. Click on "Create stack (with new resources)"
  3. In the template section, click "Upload a template file"
  4. Choose the local file "cluster-sample-app-stack.yml" as the CloudFormation template and click "Next"
  5. Enter a name for your stack
  6. Select two existing subnets (SubnetA and SubnetB) from an existing VPC
  7. Select an existing VPC and click "Next"
  8. Keep all default options and click "Next"
  9. Review all options, acknowledge the creation of IAM resources and click "Create stack"

Once your application stack is deployed, click on the "Output" tab, copy the URL and open it into your browser to access the application.

Deploying your application stack with AWS Copilot (Optional)

If you choose to deploy your application using AWS Copilot with the required add-on resources for AWS DynamoDB, take the following steps:

  1. Open a terminal window on your local machine.
  2. Run the following command to clone the repository and navigate to the project root directory:
git clone https://github.com/aws-samples/cluster-sample-app cluster-sample-app && cd cluster-sample-app
  1. Deploy the application using the following command in the root directory of your project:
copilot init --app cluster-sample-app --name demo --type "Load Balanced Web Service" --dockerfile ./Dockerfile --port 8080 --deploy

You should then be able to access the application on the DNS name provided as output.

  1. Once testing is complete, the application and its resources can be removed with the following command:
copilot app delete --yes

License

This sample application is licensed under the MIT-0 License.

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.