# Trame app failing to load from Docker container due to \`\_\_trame\_vtklocal/js/style.css\`

**URL:** https://discourse.vtk.org/t/trame-app-failing-to-load-from-docker-container-due-to-trame-vtklocal-js-style-css/15169
**Category:** Web
**Created:** [January 17, 2025, 3:51pm UTC](https://discourse.vtk.org/t/trame-app-failing-to-load-from-docker-container-due-to-trame-vtklocal-js-style-css/15169 "2025-01-17T15:51:17Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kbhasin](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/d6d6ee/32.png) [@kbhasin](https://discourse.vtk.org/u/kbhasin)
#### Post date: [January 17, 2025, 3:51pm UTC](https://discourse.vtk.org/t/trame-app-failing-to-load-from-docker-container-due-to-trame-vtklocal-js-style-css/15169/1 "2025-01-17T15:51:17Z")

</div>

Hi there,

First of all, thank you for all the great projects for handling and using meshes in all their various forms - they continue to be super helpful.

I am in the process of creating a “simple” mesh visualisation app using Trame’s localView.

I am able to successfully run it in ‘single user’ mode, by naively invoking `server.start()`, which lets me view the UI I created using trame’s widgets.

I am in the process of packaging the application up so that I can host it and have multiple users connect, each to their own session.

I am using the example provided [here](https://github.com/Kitware/trame/tree/master/examples/deploy/docker/SingleFile) as inspiration.

My application boots up successfully with no errors in the apache logs nor the launcher logs.

My browser is stuck at the screen with a spinning circle and a `Loading` message.

Inspecting the network requests made by the browser, I can see every request succeeding as expected, all the way up to the `101` response that establishes the websocket connection.

The next request is for the `__trame_vtklocal/js/style.css` file - it returns a 200, but the response body is just the exact same content as the main `index.html`.

I looked into the apache2 config, and can see:

```auto
  <Directory /deploy/server/www>
      Options Indexes FollowSymLinks
      AllowOverride None
      Require all granted
      FallbackResource /index.html
  </Directory>

```

which led me to understand that the request was failing to find the resource, and was therefore falling back to the html file.

I looked inside the `/deploy/server/www` directory and could see subdirectories for the ` __trame_vtk` and `__ trame_vuetify3` modules, containing their web assets (js, css, fonts).

I would have expected to also see a directory for `__trame_vtklocal` then - and I think its absence might explain my issues loading the stylesheets.

Is there something specific I should be doing in the setup and configuration of my Docker container to enable trame-localview to work?

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [January 17, 2025, 10:17pm UTC](https://discourse.vtk.org/t/trame-app-failing-to-load-from-docker-container-due-to-trame-vtklocal-js-style-css/15169/2 "2025-01-17T22:17:45Z")

</div>

Did you listed `trame-vtklocal` in your dependency for your app? Do you also have `vtk>=9.4` in it?

While that part should actually work, I’m expecting a followup issue with the `.wasm` file missing, which may require an extra step in the `initialize.sh`.

I’ll try to look into it soonish, but if you want to speed things up, feel free to reach out to [Kitware for some support](https://www.kitware.com/trame/).

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [January 19, 2025, 8:55pm UTC](https://discourse.vtk.org/t/trame-app-failing-to-load-from-docker-container-due-to-trame-vtklocal-js-style-css/15169/3 "2025-01-19T20:55:17Z")

</div>

A working example is available [here](https://github.com/Kitware/trame-vtklocal/tree/master/examples/docker)

---

<div class="post-metadata">

### Author: ![kbhasin](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/d6d6ee/32.png) [@kbhasin](https://discourse.vtk.org/u/kbhasin)
#### Post date: [January 20, 2025, 12:13pm UTC](https://discourse.vtk.org/t/trame-app-failing-to-load-from-docker-container-due-to-trame-vtklocal-js-style-css/15169/4 "2025-01-20T12:13:55Z")

</div>

Hi Sebastien,

Many thanks for the super fast response! I am working on a case to get my employer to formally reach out to Kitware for some support, but in the meantime I appreciate your help in these forums.

I do indeed have `trame-vtklocal` listed as a dependency for my app. I worked around the issue by including

```auto
# symlink the __trame_vtklocal directory so that the server can serve the static files
RUN mkdir -p /deploy/server/www/ __trame_vtklocal && mkdir -p /deploy/server/www/__ trame_vtklocal \
    && ln -s /deploy/server/venv/lib/python3.10/site-packages/trame_vtklocal/module/serve/js /deploy/server/www/__trame_vtklocal \
    && ln -s /deploy/server/venv/lib/python3.10/site-packages/trame_vtklocal/module/serve/wasm /deploy/server/www/__trame_vtklocal

```

in my container which seems to work well enough. The `.wasm` files are loaded on the first user connection - I’ll try the `initialize.sh` addition to speed that up.

My current issue is that my deployment is into a kubernetes cluster where we have `securityContext.runAsNonRoot: true`. This means I am unable to deploy the application, as it appears to run as root.

Is there something simple I could change to avoid this?

---

<div class="post-metadata">

### Author: ![kbhasin](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/k/d6d6ee/32.png) [@kbhasin](https://discourse.vtk.org/u/kbhasin)
#### Post date: [January 20, 2025, 6:23pm UTC](https://discourse.vtk.org/t/trame-app-failing-to-load-from-docker-container-due-to-trame-vtklocal-js-style-css/15169/5 "2025-01-20T18:23:36Z")

</div>

I managed to avoid running as root by making my own entrypoint with:

- `service apache2 restart` at the start
- the full content of `docker/scripts/run.sh`

and got it working with the end of my Dockerfile being

```auto
    # Modify Apache config to use non-privileged port
RUN sed -i 's/Listen 80/Listen 8080/g' /etc/apache2/ports.conf && \
    sed -i 's/:80/:8080/g' /etc/apache2/sites-available/001-trame.conf

# Set permissions for logs
RUN mkdir -p /var/log/apache2 && \
    chown -R trame-user:trame-user /var/log/apache2

# Set permissions for run directory
RUN mkdir -p /var/run/apache2 && \
    chown -R trame-user:trame-user /var/run/apache2

# Set permissions for run directory
RUN mkdir -p /deploy/server/logs/apache/ && \
    chown -R trame-user:trame-user /deploy/server/logs/apache/

EXPOSE 8080

USER 1000
ENTRYPOINT ["/deploy/my_entrypoint.sh"]

```
