Skip to content

Run locally

Build the dev container image once, then mount your source for fast iteration:

docker build --target devenv -f Dockerfile.devenv -t coap-devenv .
docker run -it --env-file .env \
  -p 5683:5683/udp -p 5684:5684/udp -p 8000:8000 \
  -v $(pwd):/app coap-devenv bash

# inside container:
make build/server
./build/server

Requires a running PostgreSQL instance matching your PG_CONNINFO. Use host.docker.internal to reach a database on the host.

Production image

docker build --target production -t coap-broker .

docker run \
  -p 5683:5683/udp \
  -p 5684:5684/udp \
  -p 8000:8000 \
  -v $PWD/certs:/certs:ro \
  --env-file .env \
  coap-broker

macOS

Building the server natively on Mac is not recommended — Boost causes linker/compatibility issues. Use the dev container instead. The test clients build fine natively:

make build/client
make build/device_client