When you run the docker composition
command, you get the following error and you cannot access localhost:8080.
It seems that I can't find the main.js in the src file, but when I look at the directory, it's normal, so I'm in trouble.I hope you enjoy it.
<s>[webpack.Progress] 98% after emmitting
web | ERROR Failed to compile with 2 errors 2:33:24 AM
web|
web | This relative module was not found:
web|
web | * ./src/main.js in multi ./node_modules/@vue/cli-service/node_modules/webpack-dev-server/client/index.js ./node_modules/@vue/cli-service/node_modules/webpack/hot/dev-server.js ./src/main.js, multi ./node_modules/@vue/cli-service/node_modules/webpack/hot/dev-server.js ./node_modules/@vue/cli-service/node_modules/webpack-dev-server/client/index.js ./src/main.js
Dockerfile
FROM node: 10.17.0-alpine 3.9
WORKDIR/zatubako
COPY package*.json./
RUN npm install
CMD ["npm", "run", "serve" ]
docker-compose.yml
version: '3.7'
services:
web:
container_name —web
build:
context:.
dockerfile —Dockerfile
volumes:
- '.:/zatubako'
- '/zatubako/node_modules'
ports:
- '8080:8080'
directory structure
zatubako
--docker-compose.yml
--node_modules
--src
│ - - App.vue
│ --main.js
│ --assets
│ │
│ --logo
--.babelrc
--index.html
- - webpack.config
- -.dockerignore
--package.json
- - Dockerfile
Is it OK to continue with ?
What you are seeing is the contents of the error (of which 3) on the page that is also referenced.
Try updating your webpack
npm add webpack@latest
package.json
Results:
- "webpack": "^3.6.0",
+ "webpack": "^4.43.0",
904 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
615 Uncaught (inpromise) Error on Electron: An object could not be cloned
581 PHP ssh2_scp_send fails to send files as intended
606 GDB gets version error when attempting to debug with the Presense SDK (IDE)
571 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.