Skip to content

branflake2267/debugging-multi-docker-aws-eb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Debugging a multi-container docker config hosted on Elastic Beanstalk

This is part 2. This project covers debugging the AWS configuration and deploying the simple web application to a Elastic Beanstalk multi docker container configuration. Check out part 1 which covers debugging the web application.

Build Status

Part 1: Debugging the Client & Server Source

This project extends part 1, debugging an express server and simple webpack client. Check this it for even more debugging tips and tricks.

Debugging Video Tutorial

Part 2: Debugging Client & Server Source with Elastic Beanstalk

Part 2 adds Elastic Beanstalk to the project deployment configuration. This video covers how to debug the project with Elastic Beanstalk multi-docker container format.

Debugging Video Tutorial

Project Configuration

This is the part 2 project configuration.

Setting Value
Purpose Debugging a client & server multi-container docker config hosted on Elastic Beanstalk
Server Express web server
Client Simple HTML/JavaScript webpack configuration
Client Language JavaScript
Server Language JavaScript
Architecture npm/node
IDE Visual Studio Code
CI Travis CI
Hosting Elastic Beanstalk
License GPL v3
Tutorial Youtube Tutorial

Debugging

  • From the project root, run npm install to download the libraries used in the client and server directories.

Debugging Server

Debugging Client

Debugging Client & Server Together

Debug both the client and server together. The webpack dev server provides a reverse proxy to the server.

Debugging Multi-Docker Container

Make sure things work locally in the eb local run runner!

Debugging Docker Containers

cmd details
docker ps list the docker containers and [container id]s
docker exec -it [container id] bash /bin/bash into the container. (The container name could be used as well.)
eb local run This will run the Dockerrun.aws.json multi-container configuration

Build

Build from the root of this project.

Deploy

Travis CI server deploys to Elastic Beanstalk.

Init: Configure Elastic Beanstalk Application & Enviornment

This is a reference on how the Elastic Beanstalk application was created.

Configure AWS & EB CLI

Configure the AWS CLI and EB CLI utilities.

Run aws configure to configure the AWS credentials locally.

Create Elastic Beanstalk Application

Set up the Elastic Beanstalk application.

Run eb init to configure the Elastic Beanstalk hosting config.

  • Choose the datacenter that makes sense to you. (I'll choose the default.)
  • Choose Create New Application and I use the default application name in this example.
  • Choose Multi-container Docker and the latest version.
  • Do not choose CodeCommit in this config.
  • Choose the SSH key to setup SSH, if you want to use SSH.

This will create a project file ./.elasticbeanstalk/config.yml.

Create Elastic Beanstalk Environment.

Set up an Elastic environment for your application.

Run eb create sandbox-staging-v1 where sandbox-staging-v1 is the enviornment name you choose.

Docker Config

The Dockerrun.aws.json will configure the docker container when deployed. In this configuration I won't show how to build and deploy a Docker image to ECR.