# Docker Deployment Guide ## Quick Start ### Using Docker Compose (Recommended) 1. Build and start the container: ```bash docker-compose up -d --build ``` Note: The `--build` flag ensures the image is rebuilt with the latest code changes. 2. Access the web interface: - Main interface: http://localhost:5000 - Map viewer: http://localhost:5000/map 3. Stop the container: ```bash docker-compose down ``` ### Using Docker Directly 1. Build the image: ```bash docker build -t villages-import . ``` 2. Run the container: ```bash docker run -d \ -p 5000:5000 \ -v "$(pwd)/data:/data" \ --name villages-import \ villages-import ``` 3. View logs: ```bash docker logs -f villages-import ``` 4. Stop the container: ```bash docker stop villages-import docker rm villages-import ``` ## Features ### Main Dashboard (/) - Run data processing scripts for Lake and Sumter counties - View real-time script output - Access to: - Diff Roads - Diff Addresses - Diff Multi-Use Paths - Download OSM Data ### Map Viewer (/map) - Interactive map viewer for GeoJSON files - Upload and compare OSM, Diff, and County data - Filter by removed/added features - Hide highway=service roads - Drag-and-drop layer reordering - Click on features to view properties - Accept/reject diff features ## Volume Mounts The Docker container mounts a single data directory: - `./data` → `/data` - All data files, organized by date Inside `/data`, the structure is: - `/data/latest/` - Symlink to the most recent data directory - `/data/YYMMDD/lake/` - Lake County data for that date - `/data/YYMMDD/sumter/` - Sumter County data for that date All changes are persisted on the host in the local `./data` folder. ## API Endpoints - `GET /` - Main dashboard - `GET /map` - Map viewer - `POST /api/run-script` - Execute a processing script - `GET /api/job-status/` - Get script status and logs - `GET /api/list-files` - List available GeoJSON files - `GET /data/` - Serve GeoJSON files ## Troubleshooting ### Port already in use If port 5000 is already in use, edit `docker-compose.yml`: ```yaml ports: - "8080:5000" # Change 8080 to any available port ``` ### Permission issues Ensure the data directory has proper permissions: ```bash mkdir -p data chmod -R 755 data ``` ### View container logs ```bash docker-compose logs -f ``` ### Rebuild after code changes ```bash docker-compose down docker-compose build --no-cache docker-compose up -d ```