Traffic signal coordination, green-wave optimization and a shared network editor.
1.1K
Greenwave calculates green waves along traffic corridors and optimizes signal offsets. It includes a network editor and comparisons of Standard Max-Pressure, experimental Smoothing-MP and fixed signal programs. The project is intended for experimentation, with network control modeled through queues rather than individual vehicle trajectories.
Green-wave calculation and offset optimization support trips spanning multiple signal cycles. The UI provides an elapsed-time diagram and an optional departure-time view for compact coordination analysis.
Source: LdDl/greenwave on GitHub
The image includes working environment defaults. No configuration file is required.
To provide an environment file for the command below:
cat > greenwave.env <<'EOF'
SERVER_PORT=36000
SERVER_MAIN_PATH=api
EOF
Other settings retain their image defaults.
The optional -conf flag accepts a JSON or TOML configuration file. File configuration replaces environment configuration without merging defaults. Include static_folder = "/app/static" and docs_folder = "/app/app/rest/docs" in a TOML configuration to serve the bundled UI and API documentation.
Keep SERVER_MAIN_PATH=api when using the bundled UI, which calls /api/greenwave and /api/maxpressure.
docker run --rm \
--name greenwave \
--env-file ./greenwave.env \
-p 36000:36000 \
dimahkiin/greenwave-server-app:latest
Open http://localhost:36000.
No bind mounts or persistent volumes are required. Editor projects are saved in browser localStorage and can be exported as JSON.
| Container port | Protocol | Purpose |
|---|---|---|
36000 | TCP / HTTP | Web UI, REST API and API documentation |
The server listens on all interfaces using :<port>. SERVER_HOST is read from configuration but currently does not affect the listener.
| Path | Purpose |
|---|---|
/app | Working directory |
/app/greenwave-server-app | Application binary and entrypoint |
/app/static | Bundled web UI |
/app/app/rest/docs | API documentation and swagger.json |
These defaults are defined in the Dockerfile.
| Variable | Default | Purpose |
|---|---|---|
SERVER_PORT | 36000 | HTTP listening port |
SERVER_MAIN_PATH | api | API route prefix |
SERVER_HOST | 0.0.0.0 | Read by configuration, currently unused by the listener |
SERVER_STARTUP_MESSAGE | true | Log the listening address at startup |
USE_CORS | true | Enable CORS middleware |
DOCS_PATH | /app/app/rest/docs | API documentation directory |
STATIC_PATH | /app/static | Web UI directory |
If changing SERVER_PORT, also change the container-side port in the Docker port mapping.
Paths below use the default SERVER_MAIN_PATH=api.
| Method | Path | Purpose |
|---|---|---|
| GET | / | Green-wave coordination workspace |
| GET | /network | Network editor |
| GET | /pressure | Max-Pressure workspace |
| GET | /api/greenwave/health | Service health response |
| GET | /api/greenwave/docs/ | Interactive API documentation |
| GET | /api/greenwave/docs/swagger.json | Swagger specification |
| POST | /api/greenwave/extract | Calculate green waves |
| POST | /api/greenwave/optimize | Optimize signal offsets |
| POST | /api/maxpressure/run | Compare signal controllers and evaluate a fixed-program proposal |
The interactive API documentation loads RapiDoc from an external CDN.
The runtime image uses scratch and contains a statically compiled Go binary, the web UI and API documentation. Build stages use golang:1.23-alpine and node:22-alpine.
Measured local linux/amd64 image size: approximately 7.71 MB (7.35 MiB), uncompressed. Registry download size can differ.
To build this image from the repository root:
docker build -f docker/Dockerfile \
-t dimahkiin/greenwave-server-app:latest .
No project license is declared in the checked repository, and no project license file is present. A license type and license-file link are therefore unavailable.
docker pull dimahkiin/greenwave:latest