---
sidebar_position: 10
title: Docker
---

# Docker

You can run an oracle locally and assign it to your own oracle queue to test how your program may operate in production. Mainnet oracles should always be run in high availability environments with some set of monitoring capabilities.

## Requirements

- [Docker-Compose](https://docs.docker.com/compose/install/) or another container orchestration pipeline

## Setup

Create a docker-compose.yml file with the required environment variables, as defined in [Oracle Config](./#config).

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

<Tabs>
<TabItem value="local" label="Local Machine" default>

```yaml title="docker-compose.yml"
version: "3.3"
services:
  switchboard:
    image: "switchboardlabs/node:dev-v2-06-08-22"
    network_mode: host
    restart: always
    environment:
      - LIVE=1
      - CLUSTER=devnet
      - RPC_URL=${RPC_URL}
      - ORACLE_KEY=${ORACLE_KEY}
      - HEARTBEAT_INTERVAL=15
    volumes:
      - ./configs.json:/configs.json
secrets:
  PAYER_SECRETS:
    file: /filesystem/path/to/keypair.json
```

</TabItem>
<TabItem value="gcp" label="Google Container">

```yaml title="docker-compose.yml"
version: "3.3"
services:
  switchboard:
    image: "switchboardlabs/node:dev-v2-06-08-22
    network_mode: host
    restart: always
    environment:
      - LIVE=1
      - CLUSTER=devnet
      - RPC_URL=${RPC_URL}
      - ORACLE_KEY=${ORACLE_KEY}
      - HEARTBEAT_INTERVAL=15
      - GOOGLE_PAYER_SECRET_PATH=${GOOGLE_PAYER_SECRET_PATH}
      - GCP_CONFIG_BUCKET=${GCP_CONFIG_BUCKET}
```

</TabItem>

</Tabs>

## Running

Run the following command to start the container

```bash
docker-compose up
```
