Installation
Before deploying your Worker, ensure you have configured your .env file and reviewed the Deployment recommendations. Proper security setup is essential before exposing your service to any network.
Dependencies
- Node.js
^22.23.4,^24.22.1or>=26.12.1(Node 24 LTS recommended; the supplied Docker image uses Node 24.22.1). - npm
- Docker (optional, for containerized deployment)
Manual Installation
-
Clone the Base Worker repository:
git clone https://github.com/andera-top/base-worker.gitcd base-worker -
Install dependencies:
npm install -
Configure your
.envby copying.env.example(cp .env.example .env), and editsrc/config/index.tsas needed.Set
AUTH_KEYandLB_AUTH_KEYto two distinct random values, for example withopenssl rand -hex 32. If the Worker is managed by a Load Balancer,LB_AUTH_KEYmust be the same value as the Load Balancer's. See Configuration for all variables and their validation rules: an invalid value stops the Worker at startup.You can add your configuration variables:
export const config: Config = {...coreConfig,baseWorkerSpecificConfig: {customConfigOption: process.env.CUSTOM_CONFIG || 'default-value', // Example},port: Number(process.env.PORT || '3000'),websocketPort: Number(process.env.WEBSOCKET_PORT || '3001'),} -
Start the Worker:
npm run buildnpm startDuring development,
npm run devruns the TypeScript sources directly withts-node.
Docker Installation
-
Clone the repository and navigate to the folder:
git clone https://github.com/andera-top/base-worker.gitcd base-worker -
Configure your
.envby copying.env.example, and editsrc/config/index.tsas needed. See Manual Installation to add your own configuration variables. -
Create a Docker network for Andera:
docker network create andera-net -
Build and run the stack with Docker Compose:
docker compose builddocker compose upCompose passes the variables declared in
docker-compose.yml. For MCP settings and the configuration mount, include the MCP Compose override.
Do not use
docker rundirectly. The recommended way is to usedocker compose upto ensure all dependencies and configuration are handled correctly.
The image is named andera-top/base-worker by default. It runs the application as the non-root node user, which cannot modify the application files (including dist).
Only the API port is published, on 127.0.0.1. On the andera-net network, add the Worker to the Load Balancer's workers.json as http://andera-base-worker:3000 (the Compose service name); the Load Balancer also reaches the WebSocket port over this network.
You are now ready to build your own custom Worker by adding functions, services, helpers, and tags.