-1
So, I made a container of a Vuejs application and it goes up without problem, but when accessing localhost:8080, this appears:
Follow the dockerfile:
FROM node:lts-alpine
# install simple http server for serving static content
RUN npm install -g http-server
# make the 'app' folder the current working directory
WORKDIR /app
# copy both 'package.json' and 'package-lock.json' (if available)
COPY package*.json ./
# install project dependencies
RUN npm install
# copy project files and folders to the current working directory (i.e. 'app' folder)
COPY . .
# build app for production with minification
RUN npm run build
EXPOSE 8080
CMD [ "http-server", "dist" ]
If I use "npm run dev" to test, the application goes up normal, but in the container of it. Any idea what it might be?
Your server is up, but it’s missing an index.html to open it
– bfavaretto
Hello, thanks for the answer. I have an index.html at the root of the project, follow index: <! DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Alurapic</title> </head> <body> <div id="app"></div> <script src="/dist/build.js"></script> </body> </html>
– Vinicius Duarte