This repository contains a minimal Flask application designed to be run inside Docker, with a VM bootstrap script that prepares a disposable lab environment.
This project intentionally separates:
- Infrastructure bootstrapping
- Application build & runtime
- Lab reset and teardown
No assumptions. No magic.
.
├── bootstrap.sh
├── nuke_vm.sh
├── reset_lab.sh
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
├── app.py
├── LICENSE
├── app/
│ ├── __init__.py
│ └── routes.py
├── tests/
│ └── test_health.py
├── .github/workflows/ci.yml
└── README.md
This repository is intended to be used on a fresh Linux VM.
The workflow is:
- Provision a raw VM
- SSH into the VM
- Copy and execute
bootstrap.sh - Manually deploy and test the application
- Reset or destroy the lab
The VM is disposable by design.
The bootstrap script performs environment preparation only.
-
Installs Docker CE
-
Installs docker-compose (standalone)
-
Enables Docker TCP on
GUEST_IP:2375 -
Configures UFW to allow:
- SSH (22)
- Docker TCP (2375)
- Flask app (5000)
- Only from the SSH client IP
-
Installs:
- Terraform
- Ansible
- AWS CLI
- yq
- lazygit
-
Creates a bare Git repository on the VM:
/home/<user>/repos/docker-flask-app.git
- Does NOT clone this repository
- Does NOT run
docker compose - Does NOT deploy the application
This is intentional.
From your local machine:
scp bootstrap.sh user@VM_IP:/tmp/bootstrap.sh
ssh user@VM_IP
chmod +x /tmp/bootstrap.sh
sudo /tmp/bootstrap.shA reboot after completion is recommended.
After bootstrap, clone or copy this repository onto the VM:
git clone <this-repo-url>
cd <repo>Build and start the app:
docker-compose up --buildThe Flask app will be available on:
http://VM_IP:5000
docker psdocker-compose exec web pytestTo remove containers, images, volumes, and cached state:
./reset_lab.shThis keeps Docker and tooling installed.
To purge Docker, Terraform, Ansible, AWS CLI, firewall rules, and all lab artifacts:
sudo ./nuke_vm.shThe VM is expected to be discarded afterward.
- Docker TCP (
2375) is enabled without TLS - Firewall access is restricted to the SSH client IP
- No security hardening is applied
- This setup is not production-safe
This repository is intended strictly for:
- Learning
- Testing
- CI validation
- Disposable lab environments