Use Case
Your Next.js service runs via Compose. You need branch-isolated environments, deterministic port mapping, and health checks that detect individual service failure.
Documentation
Use this when your app runs in containers and you want workspace-isolated host ports with clear container health visibility.
Your Next.js service runs via Compose. You need branch-isolated environments, deterministic port mapping, and health checks that detect individual service failure.
FRONTEND_PORTMuxy assigns one host port per workspace. Compose maps host $FRONTEND_PORT to container port 3000.
services:
web:
build: .
ports:
- "${FRONTEND_PORT}:3000"
environment:
- PORT=3000cp /shared/.env .envCopying .env gives each workspace an isolated env file. Symlink can reduce duplication, but one edit impacts all linked workspaces.
FRONTEND_PORT=$FRONTEND_PORT docker compose up --buildThe process keeps Compose attached in one terminal, which is useful for live logs and interactive shutdown.
http://localhost:$FRONTEND_PORTThis targets the workspace-specific host mapping. Without named ports, one workspace can accidentally open another workspace's frontend.
docker compose stop
# or
docker compose downdocker compose stop: stop containers but keep networks/volumes/containers for faster resume.docker compose down: remove containers and network; cleaner reset, slower next startup.stop for day-to-day pause/resume; use down when you need a clean teardown.docker ps | grep -q myapp_webStatus checks make service health explicit in UI and can notify or restart on failure.