DEV Community

Ngozi
Ngozi

Posted on

Deploying a Dockerized Browser Game with Elastic Beanstalk

Architectural Diagram


Introduction
I built a simple, colorful browser game using HTML/CSS/JavaScript, containerized it with Docker, and deployed it using AWS Elastic Beanstalk — a service that simplifies deployment for containerized applications.

This post covers the full process — from writing the game to seeing it live on a public URL.

Step 1: Building the Game
I created a browser game called Color Click. The goal is simple: click as many randomly appearing colorful dots as you can. It’s fast, fun, and great for beginners in frontend or game logic.

Technologies used:

  • HTML, CSS, JavaScript (Frontend)

  • Nginx (as the static file server)

  • Docker (to containerize the app)

Image Build Complete

Container Running on Port 80

Game Accessed in Browser via localhost


Step 2: Version Control with GitHub
I initialized a Git repo, committed all files (Dockerfile, HTML, CSS, JS), and pushed the code to GitHub.

Files pushed to GitHub


Step 3: Deploy to AWS Elastic Beanstalk
Elastic Beanstalk allows you to run Docker containers easily without managing infrastructure manually. Here’s what I did:

  • Zipped the project files (including Dockerfile)

  • Created a new Elastic Beanstalk app via the AWS Console

  • Chose the Docker platform

  • Set up:

  1. Service role

  2. EC2 instance profile

  3. Key pair (for SSH)

  4. Public IP assignment

  5. Default VPC with public subnet

Elastic Beanstalk Environment Successfully Created


Step 4: Access the Game via the Web
After deployment, Elastic Beanstalk assigned a public domain. I simply opened the URL and saw the game running — served via Nginx inside my Docker container on an EC2 instance.

Game Accessed via Elastic Beanstalk Assigned Public Domain URL


Here’s my GitHub Repo

Let’s Connect on LinkedIn!

Top comments (0)