---
title: "How can I use the Apollo Router with Rhai scripts on Docker?"
canonical: "https://support.apollographql.com/space/ETKB/646479909/How%20can%20I%20use%20the%20Apollo%20Router%20with%20Rhai%20scripts%20on%20Docker%3F"
format: markdown
---
If you want to use Rhai scripts on a Docker image, the [Apollo Router configuration file](https://www.apollographql.com/docs/router/configuration/overview)) must contain a `rhai` key and a nested `scripts` or `main` key. The value for `scripts` declares the directory of `.rhai` files, which is `./rhai` by default. This directory is where the Router loads the `main.rhai` file from. You can override the default `main.rhai` file with `main`.

```
# This is a top-level key. It MUST define at least one of the two
# sub-keys shown, even if you use that subkey's default value.
rhai:
  # Specify a different Rhai script directory path with this key.
  # The path can be relative or absolute.
  scripts: "/dist/rhai/"

  # Specify a different name for your "main" Rhai file with this key.
  # The router looks for this filename in your Rhai script directory.
  main: "test.rhai"

```

You can review [this repo on GitHub](https://github.com/farawaysouthwest/router-rhai-example) for a complete example. More info about implementing Rhai scripts with the Router can be found in our [dev docs](https://www.apollographql.com/docs/router/customizations/rhai).