A simple containerized application with a WebUI frontend and a backend API designed to run on Docker locally and deployable to Azure.
- Frontend: Node.js/Express web server serving a single-page application with a health check button
- Backend: Python Flask API with health check endpoints
- Containerization: Docker containers orchestrated with Docker Compose
azuretest001/
├── backend/
│ ├── app.py # Flask API with health endpoints
│ ├── requirements.txt # Python dependencies
│ └── Dockerfile # Backend container configuration
├── frontend/
│ ├── server.js # Express server
│ ├── package.json # Node.js dependencies
│ └── Dockerfile # Frontend container configuration
├── docker-compose.yml # Multi-container orchestration
└── README.md # This file
-
Backend API:
/health- Returns health status with timestamp/ping- Simple ping/pong endpoint- CORS enabled for cross-origin requests
-
Frontend WebUI:
- Clean, modern interface
- Single button to ping backend
- Visual feedback (success/error/loading states)
- Real-time status display
- Docker Desktop installed and running
- Docker Compose (included with Docker Desktop)
-
Clone or navigate to the project directory:
cd c:\Users\lobra\Documents\Repos\azuretest001
-
Build and start both containers:
docker-compose up --build
-
Access the application:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000/health
-
Stop the application:
# Press Ctrl+C in the terminal, then: docker-compose down
Backend only:
cd backend
docker build -t healthcheck-backend .
docker run -p 5000:5000 healthcheck-backendFrontend only:
cd frontend
docker build -t healthcheck-frontend .
docker run -p 3000:3000 -e BACKEND_URL=http://localhost:5000 healthcheck-frontend- Open your browser to http://localhost:3000
- Click the "Ping Backend" button
- You should see a success message with:
- Backend status
- Response message
- Timestamp
cd backend
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -r requirements.txt
python app.pycd frontend
npm install
npm start# Build containers
docker-compose build
# Start containers in foreground
docker-compose up
# Start containers in background
docker-compose up -d
# View logs
docker-compose logs -f
# Stop containers
docker-compose down
# Remove containers and volumes
docker-compose down -v
# List running containers
docker ps
# View backend logs
docker logs healthcheck-backend
# View frontend logs
docker logs healthcheck-frontendFLASK_ENV: Set toproductionordevelopment
BACKEND_URL: URL of the backend API (default:http://backend:5000in Docker)PORT: Frontend server port (default:3000)
This application is ready for Azure deployment. Potential Azure services:
- Azure Container Instances (ACI): Simplest option for running containers
- Azure Container Apps: Serverless container platform with auto-scaling
- Azure Kubernetes Service (AKS): For production-grade orchestration
- Azure App Service: Container deployment with managed infrastructure
- Azure CLI installed
- Azure subscription
- Azure Container Registry for storing images
Backend not responding:
- Check if backend container is running:
docker ps - View backend logs:
docker logs healthcheck-backend - Test backend directly: http://localhost:5000/health
Frontend can't reach backend:
- Ensure both containers are on the same network
- Check
BACKEND_URLenvironment variable - Verify CORS is enabled in backend
Port already in use:
- Change ports in
docker-compose.yml - Or stop the process using the port
This repository includes large files and secrets that should NOT be committed:
Already Protected (via .gitignore):
- ✅ Machine learning models (
*.h5,*.keras,*.weights.h5) - 90-100MB each - ✅ Python cache (
__pycache__/,*.pyc) - ✅ Environment files (
.env,*.tfvars) - ✅ Terraform state and providers (
.terraform/) - ✅ Node modules (
node_modules/) - ✅ Secrets and credentials
Safe to Commit:
- ✅ Source code (
*.py,*.js,*.html) - ✅ Dockerfiles and docker-compose.yml
- ✅ Documentation (
*.md) - ✅ Configuration templates (
.env.example,*.tfvars.example) - ✅ Small test images in
profile_images/(sample data)
Important: See SECURITY.md for complete secrets management guide.
# Check what will be committed
git status
# Add all files (respects .gitignore)
git add .
# Verify no secrets are staged
git status | Select-String ".env|.tfvars|secret"
# Commit
git commit -m "Initial commit: Health Check application with ML classification"
# Add remote (replace with your repo URL)
git remote add origin https://github.com/yourusername/azuretest001.git
# Push to remote
git push -u origin mainThe trained ML models (90-100MB each) are excluded from git. For deployment:
- Models are included in Docker images (built locally, pushed to ACR)
- For team sharing, consider Azure Blob Storage or Git LFS
- Current deployment: Models built into container images
MIT