This project create the popular 2048 game using Docker and deploys it to AWS Elastic Beanstalk. The 2048 game source code is available at https://github.com/gabrielecirulli/2048. Thanks to N4si for the step by step walkthrough.
Before getting started, ensure you have the following prerequisites:
- An AWS account with appropriate IAM permissions.
- Docker installed on your local machine.
- AWS Elastic Beanstalk Command Line Interface (EB CLI) installed on your local machine.
Follow the steps below to deploy the 2048 game on AWS Elastic Beanstalk.
-
Create the Dockerfile.
-
Build the Docker image. Replace 2048-docker with your desired image name.
docker build -t 2048-docker .
-
Run the Docker container to test the game locally.
docker run -d -p 80:80 2048-docker
-
The game should now be accessible in your web browser at http://localhost:80.
-
Stop the Docker container once you have tested the game.
docker stop $(docker ps -a -q)
-
Create an AWS Elastic Beanstalk application using the EB CLI. Replace my-2048-game with your desired application name.
eb init -p docker my-2048-game
-
Create an environment and deploy the game to AWS Elastic Beanstalk.
eb create my-2048-environment
-
Access your deployed game through the provided Elastic Beanstalk URL.
To terminate the AWS resources and Docker containers created for this project, follow these steps:
-
Terminate the Elastic Beanstalk environment.
eb terminate my-2048-environment
-
Remove the AWS Elastic Beanstalk application.
eb terminate my-2048-game
-
Remove the Docker image and container.
docker stop $(docker ps -a -q) docker rmi docker-2048
This project is licensed under the MIT License - see the LICENSE file for details.
2048 Game by gabrielecirulli Docker AWS Elastic Beanstalk
Feel free to contribute to this project and make improvements. If you encounter any issues, please open a GitHub issue.