# Docker Deployment for Markov Economics Simulation This directory contains Docker configuration files for containerizing the Markov Economics Simulation App. ## Files - `Dockerfile` - Multi-stage Docker build configuration - `docker-compose.yml` - Docker Compose configuration for easy deployment - `.dockerignore` - Files to exclude from Docker build context ## Quick Start ### Using Docker Compose (Recommended) ```bash # Build and start the application docker-compose up --build # Run in detached mode docker-compose up -d --build # Stop the application docker-compose down ``` ### Using Docker directly ```bash # Build the image docker build -t markov-economics . # Run the container docker run -p 5000:5000 markov-economics # Run with environment variables docker run -p 5000:5000 \ -e FLASK_ENV=production \ -e FLASK_APP=run.py \ markov-economics ``` ## Access Once running, the application will be available at: - Main application: http://localhost:5000 - Health check: http://localhost:5000/health ## Configuration ### Environment Variables - `FLASK_ENV` - Flask environment (development/production) - `FLASK_APP` - Entry point file (run.py) - `PYTHONUNBUFFERED` - Ensure Python output is not buffered ### Ports - `5000` - Main application port (Flask + SocketIO) ## Health Check The container includes a health check that verifies the application is responding correctly at `/health`. ## Security - Runs as non-root user (`appuser`) - Uses Python slim base image - Excludes development files via `.dockerignore`