I'm trying to dockerize a frontend app which was created using vite and vue3. It is not working as a container. Here is the error response.
(!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling.
VITE v3.2.4 ready in 191 ms
➜ Local: http://localhost:5173/
➜ Network: http://172.17.0.2:5173/
(!) Could not auto-determine entry point from rollupOptions or html files and there are no explicit optimizeDeps.include patterns. Skipping dependency pre-bundling.
Dockerfile
# base image
FROM node:16.3.0-alpine
# set working directory
WORKDIR /app
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
# install and cache app dependencies
COPY package.json /app/package.json
RUN npm install
RUN npm install @vue/cli@3.7.0 -g
# start app
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
vite.config.ts
export default defineConfig({
plugins: [vue(), vueJsx()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
build: {
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
}
}
}
})
index.html
exist in the same directory with vite.config.ts
and .Dockerfile
. Thanks in advance.