# window.prodigy not available when run in Docker

**URL:** <https://support.prodi.gy/t/window-prodigy-not-available-when-run-in-docker/2579>\
**Category:** Uncategorized\
**Tags:** usage, front-end, solved\
**Created:** [February 24, 2020, 2:39pm UTC](https://support.prodi.gy/t/window-prodigy-not-available-when-run-in-docker/2579 "2020-02-24T14:39:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wamadeus](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/wamadeus/32/1223_2.png) [@Wamadeus](https://support.prodi.gy/u/Wamadeus)\
**Post date:** [February 24, 2020, 2:39pm UTC](https://support.prodi.gy/t/window-prodigy-not-available-when-run-in-docker/2579/1 "2020-02-24T14:39:51Z")

</div>

Hello,

I "dockerized" my application with a custom recipe (also tried with a standard one). Where I run the prodigy command locally, in the browser's console I can access to window.prodigy and my custom javascript works fine. Unfortunately, when I launch the app via Docker, everything's work fine but the window.prodigy global var is not accessible anymore.

I can't find out why 😕

Did someone face the same issue?

Thanks!

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [February 24, 2020, 6:19pm UTC](https://support.prodi.gy/t/window-prodigy-not-available-when-run-in-docker/2579/2 "2020-02-24T18:19:04Z")

</div>

How are you defining your custom JavaScript? Are you using the `prodigy.json` or a custom recipe? `window.prodigy` is only available if custom JavaScript is enabled, i.e. if there's a `"javascript"` setting in your `prodigy.json` or recipe config.

If you were using the `prodigy.json`, maybe that file isn't available in your Docker container? By default, Prodigy will first check the user home directory and then the current working directory.

---

<div class="post-metadata">

**Author:** ![Wamadeus](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/wamadeus/32/1223_2.png) [@Wamadeus](https://support.prodi.gy/u/Wamadeus)\
**Post date:** [February 24, 2020, 7:45pm UTC](https://support.prodi.gy/t/window-prodigy-not-available-when-run-in-docker/2579/3 "2020-02-24T19:45:33Z")

</div>

Hi Ines,

thank you for your answer.

The javascript is in the recipe config

```
return {
    'dataset': dataset,
    'view_id': 'html',
    'stream': stream,
    'update': update,
    'config': {
        "javascript": multiple_slider_js,
        "global_css": global_css
    },
}

```

(Yes, as you can see, javascript carousel are integrated in the app 🙂 and it looks good, in local at least)

The javascript is correctly imported, I can see the script tag in the HTML source code on the web service. The `window.prodigy` var is correctly accessible when I run outside of docker.

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [February 25, 2020, 10:28am UTC](https://support.prodi.gy/t/window-prodigy-not-available-when-run-in-docker/2579/4 "2020-02-25T10:28:31Z")

</div>

Thanks for the update! And that's strange – exposing the globals via `window.prodigy` happens entirely on the client, right before the `<script>` tag is added, so I don't see how the Docker setup would make any difference here 🤔

So when you open the dockerized app in your browser and you type `window.prodigy` into the console, it's not accessible either? Is there any error in the console?

---

<div class="post-metadata">

**Author:** ![Wamadeus](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/wamadeus/32/1223_2.png) [@Wamadeus](https://support.prodi.gy/u/Wamadeus)\
**Post date:** [February 25, 2020, 5:09pm UTC](https://support.prodi.gy/t/window-prodigy-not-available-when-run-in-docker/2579/5 "2020-02-25T17:09:31Z")

</div>

Thanks,

No error in the console and no `window.prodigy`

Actually the javascript and the global\_css are not included in the dockerized version, even if I pass only the global\_css like this

```
return {
    'dataset': dataset,
    'view_id': 'html',
    'stream': get_stream(),
    'update': update,
    'config': {
        "global_css": '.prodigy-content.c0172 {width: 100%}'
    },
}
```

---

<div class="post-metadata">

**Author:** ![ines](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/ines/32/3_2.png) [@ines](https://support.prodi.gy/u/ines)\
**Post date:** [February 26, 2020, 11:08am UTC](https://support.prodi.gy/t/window-prodigy-not-available-when-run-in-docker/2579/6 "2020-02-26T11:08:00Z")

</div>

> [@Wamadeus](#):
>
> Actually the javascript and the global\_css are not included in the dockerized version, even if I pass only the global\_css like this

Do you have a `prodigy.json` in your home directory or working directory that maybe overrides those? The idea behind this is that the recipe can define the defaults, and then you can override those in your global or local configuration if needed. So if your Docker container has a `prodigy.json` that sets something like `"javascript": null`, but your local installation doesn't, that could explain what's going on.

---

<div class="post-metadata">

**Author:** ![Wamadeus](https://sea2.discourse-cdn.com/flex020/user_avatar/support.prodi.gy/wamadeus/32/1223_2.png) [@Wamadeus](https://support.prodi.gy/u/Wamadeus)\
**Post date:** [February 26, 2020, 2:25pm UTC](https://support.prodi.gy/t/window-prodigy-not-available-when-run-in-docker/2579/7 "2020-02-26T14:25:53Z")

</div>

Totally right!

Thank you.

Locally the PRODIGY\_HOME was not defined so the `prodigy.json` was not found and the `global_css` was not owerwritten but it was in Docker env with a `global_css` set to `null`.
