This guide explains how to build and run In the Loop services using Docker.
In the Loop consists of three Docker services:
- web: Production frontend served via nginx
- sync: Backend API and WebSocket sync service (Cloudflare Worker)
- iframe-outputs: Sandboxed output rendering service
- Docker installed and running
To build all services:
docker compose buildTo build without cache:
docker-compose build --no-cacheTo build and start all services:
docker-compose up --buildTo run all services together using docker-compose:
Start all services in the foreground:
docker compose upThe services communicate via the intheloop-network Docker network:
- The
webservice connects tosyncathttp://sync:8787(internal Docker DNS) - All services can communicate using their service names as hostnames
You can build and run individual services for testing. The web service requires the sync service to be accessible.
Build the web image:
docker build -f Dockerfile.web -t intheloop-web:latest .Running with docker-compose (recommended):
The web service automatically connects to the sync service via Docker network DNS:
docker compose up webRunning standalone:
When running standalone, you need to specify where the sync service is located using the SYNC_HOST environment variable:
# If sync is running on host machine (Mac/Windows)
docker run -p 5173:5173 -e SYNC_HOST=host.docker.internal intheloop-web:latest
# If sync is running on host machine (Linux)
docker run -p 5173:5173 -e SYNC_HOST=172.17.0.1 intheloop-web:latest
# If sync is running in another Docker container with a known IP
docker run -p 5173:5173 -e SYNC_HOST=<container-ip> intheloop-web:latestThe web service will be available at http://localhost:5173. By default, SYNC_HOST is set to sync (for docker-compose usage).
Build the iframe-outputs image:
docker build -f Dockerfile.iframe-outputs -t intheloop-iframe-outputs:latest .Run the iframe-outputs service:
docker run -p 8000:8000 intheloop-iframe-outputs:latestThe iframe-outputs service will be available at http://localhost:8000.
Build the sync image:
docker build -f Dockerfile.sync -t intheloop-sync:latest .Run the sync service:
docker run -p 8787:8787 intheloop-sync:latestThe sync service will be available at http://localhost:8787.
SYNC_HOST(default:sync): Hostname or IP address of the sync service. Used by nginx to proxy API requests. Set tosyncfor docker-compose, or override for standalone runs.
The sync service uses environment variables from .dev.vars file. See .dev.vars.example for configuration options.
This error occurs when running the web container standalone without setting SYNC_HOST. Either:
- Use docker-compose to run all services together, or
- Set
SYNC_HOSTenvironment variable when running the web container standalone
- Verify the sync service is running and accessible
- Check that
SYNC_HOSTis set correctly for your environment - On Linux, you may need to use the Docker bridge IP (
172.17.0.1) instead ofhost.docker.internal - Ensure both containers are on the same Docker network if running separately