@axiom-lattice/microsandbox-service
v0.0.9
Published
`@axiom-lattice/microsandbox-service` runs an HTTP service for managing microsandbox-backed sandbox lifecycle operations.
Downloads
839
Readme
@axiom-lattice/microsandbox-service
@axiom-lattice/microsandbox-service runs an HTTP service for managing microsandbox-backed sandbox lifecycle operations.
This package is intended to be deployed as a long-running process. Its primary runtime entrypoint is the lattice-microsandbox-service CLI.
Install and Build
Build the package from the monorepo root:
pnpm --filter @axiom-lattice/microsandbox-service buildAfter building, you can start the service through the package CLI or the package start script.
CLI Usage
The package exposes this executable:
lattice-microsandbox-serviceSupported flags:
--host <string>--port <number>
Example:
lattice-microsandbox-service --host 0.0.0.0 --port 4002Configuration
Runtime configuration is resolved in this order:
- CLI arguments
- Environment variables
- Defaults
Supported environment variables:
HOSTdefault:0.0.0.0PORTdefault:4002
Example:
HOST=0.0.0.0 PORT=4002 lattice-microsandbox-serviceStartup Examples
Start with CLI flags:
lattice-microsandbox-service --host 127.0.0.1 --port 4002Start with environment variables:
HOST=127.0.0.1 PORT=4002 lattice-microsandbox-serviceStart through the package script:
pnpm --filter @axiom-lattice/microsandbox-service startCheck service health:
curl http://127.0.0.1:4002/healthProcess Manager Examples
systemd
[Unit]
Description=Axiom Lattice Microsandbox Service
After=network.target
[Service]
ExecStart=/usr/local/bin/lattice-microsandbox-service --host 0.0.0.0 --port 4002
Restart=on-failure
Environment=HOST=0.0.0.0
Environment=PORT=4002
[Install]
WantedBy=multi-user.targetsupervisor
[program:microsandbox-service]
command=/usr/local/bin/lattice-microsandbox-service --host 0.0.0.0 --port 4002
autostart=true
autorestart=true
environment=HOST="0.0.0.0",PORT="4002"docker
CMD ["lattice-microsandbox-service", "--host", "0.0.0.0", "--port", "4002"]Local Development
Run the package in watch mode from the monorepo root:
pnpm --filter @axiom-lattice/microsandbox-service devThis command watches source files, rebuilds the package, and restarts the service automatically.
Operational Notes
- Invalid startup configuration exits non-zero.
- Startup failures exit non-zero.
SIGINTandSIGTERMtrigger graceful shutdown.
