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 (version 18 or higher)
- npm or yarn
- Docker (optional, for containerized deployment)
Manual Installation
-
Clone the Base Worker repository:
git clone https://github.com/andera-top/base-worker.git
cd base-worker -
Install dependencies:
npm install
# or
yarn install -
Configure your
.env
by copying.env.example
, and editsrc/config/index.ts
as needed.You can add your configuration variables:
export const config: Config = {
...coreConfig,
baseWorkerSpecificConfig: {
customConfigOption: process.env.CUSTOM_CONFIG || 'default-value', // Example
},
port: parseInt(process.env.PORT || '3000', 10),
websocketPort: parseInt(process.env.WEBSOCKET_PORT || '3001', 10),
} -
Start the Worker:
npm run start
# or
yarn start
Docker Installation
-
Clone the repository and navigate to the folder:
git clone https://github.com/andera-top/base-worker.git
cd base-worker -
Configure your
.env
by copying.env.example
, and editsrc/config/index.ts
as 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 build
docker-compose upThis will start the Base Worker with all environment variables from your
.env
file.
Do not use
docker run
directly. The recommended way is to usedocker-compose up
to ensure all dependencies and configuration are handled correctly.
The image is named andera-top/base-worker
by default.
You are now ready to build your own custom Worker by adding functions, services, helpers, and tags.