Skip to main content

Installation

info

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

  1. Clone the Base Worker repository:

    git clone https://github.com/andera-top/base-worker.git
    cd base-worker
  2. Install dependencies:

    npm install
    # or
    yarn install
  3. Configure your .env by copying .env.example, and edit src/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),
    }
  4. Start the Worker:

    npm run start
    # or
    yarn start

Docker Installation

  1. Clone the repository and navigate to the folder:

    git clone https://github.com/andera-top/base-worker.git
    cd base-worker
  2. Configure your .env by copying .env.example, and edit src/config/index.ts as needed. See Manual Installation to add your own configuration variables.

  3. Create a Docker network for Andera:

    docker network create andera-net
  4. Build and run the stack with Docker Compose:

    docker-compose build
    docker-compose up

    This will start the Base Worker with all environment variables from your .env file.

Do not use docker run directly. The recommended way is to use docker-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.