The Hangman Flask App is a fun, interactive web-based game where players guess a word one letter at a time to avoid 'hanging'. This Flask application is containerized for ease of deployment using Docker.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
What things you need to install the software and how to install them:
- Download Docker desktop
- Find your IDE, I used IntelliJ
- Setup your python environment and edit your run configuration
- Make sure you install your requirements.txt
For more information on using Docker and deploying applications, consider the following tutorials:
- Docker 101 Tutorial
- Swarm Mode Tutorial
- Heroku GitHub Integration
- DevSecOps Tutorial for Beginners | CI Pipeline with GitHub Actions and Docker Scout
A step by step series of examples that tell you how to get a development env running.
Clone the repo:
bash
git clone https://github.com/rowingsjr/hangman_flask_app.git
Navigate to the cloned directory:
bash
cd hangman_flask
Build the Docker image:
bash
docker build -t hangman_flask .
Run the Docker container:
bash
docker run -p 5000:5000 hangman_flask
The app should now be running on localhost:5000.
This is a web app that will launch a hangman app, and you will be able to play a simple hangman game. Enjoy!
Read through the tutorials, and you will be able to deply the app. Test it on your local machine first.
Run the container in detached mode with the following command:
bash
docker run -d -p 5000:5000 hangman_flask
Initialize Docker Swarm:
bash
docker swarm init
Deploy the stack:
bash
docker stack deploy -c docker-compose.yml hangman_stack
The application will be accessible at http://localhost:5000 or the IP of any Docker Swarm node.
If you wish to develop the app, you can mount a volume to the Docker container to allow for live editing of the Flask application files.
Richard Owings Jr - Graduate Student MS Computer Science - Initial work and development of project - rowingsjr
Special Ackonwledgments to Dr. Verdicchio for allowing this to be a success.
docker
docker-compose