Empty page on every reload with vuejs dockerfile deployment.

I deployed a Vue.js app with a Dockerfile and http server.

Now when I am using the app and reload it at any page I get an empty page. But why?

Here my Dockerfile:

FROM node:lts-alpine

RUN npm install -g http-server


COPY package*.json ./

RUN npm install

COPY . .

RUN npm run build

CMD [ "http-server", "dist" ]

Hi @Wickenico I have a guess of what it could be, if I’m correct:

  1. You’re using the history mode for pretty URLs so site.fly.dev/something instead of site.fly.dev/#/something
  2. You can access site.fly.dev/ (root) and it works changing to other places like site.fly.dev/something-else
  3. If you’re not on the root and refresh the page you get an empty response

My guess for that is that you’d need to setup a proxy for all routes to your index.html. This would the this common issue:

Vue Router has some recommendations for how to do that:

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