Docker subfolder install not working due to Ember-CLI proxy error?

(I’ve tagged this #unsupported-install but would appreciate guru input regardless :slight_smile:)

Guys, I’m trying to run a basic Discourse image in a simple-ish(?) multi docker container setup via Docker Compose.

Here’s the basics:

  • The forum is living in a subfolder, lets call it /board, so (
  • nginx is passing calls to /board:443 to localhost:4000.
  • Discourse rails was running on port 4000 (because 3000 is being used by something else)
  • included in the Rails ENVs is a crucial setting which sets this up to work:

Now I’ve updated the version of Discourse (pre Ember-CLI) and things are no longer working.

So, of course, I add a container for Ember-CLI which runs:

    command: bin/ember-cli --port 4000 --proxy "http://localhost:4200"

So Ember is now handling the calls coming in on 4000 in the first instance.

I move Discourse rails container to port 4200 and kick things off.

First the good news:

  • curling the dev site works!

Now the bad news:

  • Doesn’t work in browser, why?:

    because it’s apparently trying to reach Discourse but requesting:


giving the error:

Discourse Ember CLI Proxy Error
Error: Could not get

FetchError: invalid json response body at reason: Unexpected token N in JSON at position 0

instead of

/board/bootstrap.json (which returns data).

If instead I use this config:

    command: bin/ember-cli --port 4000 --proxy ""

I get a Rails error:

Routing Error
No route matches [GET] "/forum"

Yet not a few lines away, it provides me with:

bootstrap_path	GET	/bootstrap(.:format)	
bootstrap#index {:format=>/(json|html|\*\/\*)/}

Which is exactly the path I was trying to reach?

How do I make Ember smart enough to proxy to the subfolder when it’s trying to get the bootstrap info?, ie:

Remember, in this instance, Ember is running in its own container.

1 Like

How are you building the container? You’re launching that container from docker-compose?

There was . . . uh, some env setting . . . that could be used to try to keep ember-cli from working; did you remove that? (I think it’s ignored now anyway?)

Yes, these container definitions are in a docker-compose.

There are no environment settings in the ember-cli container currently.

You’re building the container with launcher with the stuff from Serve Discourse from a subfolder (path prefix) instead of a subdomain before you get docker-compose to launch it?

What’s the proxy? Maybe just launch discourse with launcher and use docker-args to set other stuff that is needed? For traefik, I do something like this:

        --docker-args "-l traefik.frontend.rule=Host:{{discourse_hostname}};PathPrefix:/{{discourse_subfolder}} \
        -l traefik.frontend.entryPoints=https \
        -l traefik.backend={{discourse_shortname}} \
        -l traefik.port=80 \
        {{ docker_extra_args | default('')}}"
1 Like

No, I’m just using a Discourse Docker Image (version 2.8.9).

(actually the image is hosted locally, but its pretty much:)

    command: bin/rails s -b -p 4200
    image: discourse:v2.8.9
      DISCOURSE_PORT: 4200
      - 4200:4200
    command: bin/ember-cli --port 4000 --proxy ""
    image: discourse:v2.8.9
      - 4000:4000

Hmm. In that case I can’t explain how it ever worked. I think you need to build an image with launcher that adds the stuff to support subfolder installs.


My bad for not adding this to the Ember CLI container (it was already on the Rails container):


Ooops :sweat_smile:

FYI the key file in source is I believe this:


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.