Im migrating my existing React-Vite app into a docker container, but I keep getting this error when running the docker build command:
> [email protected] postinstall > npm run build > [email protected] build > vite build vite v4.5.3 building for production… â 0 modules transformed. â built in 8ms Could not resolve entry module “index.html”. error during build: RollupError: Could not resolve entry module “index.html”.
This is my Dockerile:
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
EXPOSE 5173
CMD [ "npm", "run", "dev", "--", "--host", "0.0.0.0"]
This is my .dockerignore
node_modules
dist
jsdoc.json
.gitignore
.vscode
.prettierignore
.prettierrc
.jsconfig.json
.eslintignore
.eslintrc.cjs
And this is my project structure: enter image description here
Any suggestions on what can I do to solve this problem? Im pretty new to docker and all that stuff
Alejandro González Almazán is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.