Tag: docker webpack docker

docker工人在运行时缺lesswebpack编译的文件

我遇到了一个问题,我确定这个问题对于一个docker专家来说是非常明显的,但是却在我身上丢失了。 下面是我的dockerfile,其中我添加了几个“ls”,以便可以查看webpack生成的文件。 第一个“ls”正确显示 Step 8 : RUN ls server/public —> Running in 67bc7ee5f832 bundle.css bundle.js index.html 但第二个LS不是 web_1 | index.html Dockerfile: FROM node:6.2 # Create app directory RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY package.json /usr/src/app/ RUN npm i COPY . /usr/src/app/ # Build Static Resources RUN npm run build # ls here shows correct […]

Webpack不会生成build.js

我将我的代码库移动到了dockerformat。 我有一个docker-compose文件,命令如下: command: bash -c "rm -rf node_modules && npm install && npm run dev" 和一切工作正常,我使用rm -rf node_modules因为它给我一些丢失包(从我的MAC)的错误。 这样做只是得到重新创build,并在本地主机上正常工作。 我也添加了卷,所以当我改变我的代码中的东西时,它会反映在我的容器中,这也可以正常工作(除了热重载,但这不是什么大不了的)。 现在我通常只是在我的docker-compose文件中注释掉以下command: bash -c "rm -rf node_modules && npm install && npm run dev"行: command: bash -c "rm -rf node_modules && npm install && npm run dev" ,而是添加: command: bash -c "rm -rf node_modules && npm […]