Docker Setup

Quick Start

git clone <buem-repository-url>
cd buem
docker compose up

The API is now available at http://localhost:5000. Test it:

curl http://localhost:5000/api/health

Environment Variables

Variable

Default

Description

BUEM_WEATHER_DIR

/app/data/weather

Weather CSV directory (mounted read-only)

BUEM_RESULTS_DIR

/app/results

Output directory for timeseries files

BUEM_CBC_EXE

/opt/conda/envs/buem_env/bin/cbc

Path to the CBC solver binary (used by MILP path)

Volume Mounts

The provided docker-compose.yml mounts:

  • ./src/buem/data/weather/app/data/weather (read-only)

  • ./src/buem/logs/app/logs

  • ./results/app/results

Manual Build

docker build -t buem:latest .
docker run -d --name buem-api \
  -p 5000:5000 \
  -v $(pwd)/src/buem/data/weather:/app/data/weather:ro \
  -v $(pwd)/results:/app/results \
  buem:latest

Health Check

The Compose file includes a health check that calls /api/health every 30 s. Monitor with:

docker compose ps
docker compose logs buem-api
services:
  buem:
    # ... buem configuration
    deploy:
      replicas: 3

  nginx:
    image: nginx:alpine
    ports:
      - "80:80"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf

Troubleshooting

Common Issues

  1. Weather data not found: Ensure proper volume mounting and file permissions

  2. Port conflicts: Check that port 5000 is available

  3. Memory issues: Increase container memory limits for large building datasets

Debug Mode

Run container in debug mode:

docker run -it --rm \\
  -p 5000:5000 \\
  -e FLASK_ENV=development \\
  buem:latest

Next Steps

Once your container is running, proceed to API Endpoints to learn about the available API endpoints.