I'm trying to run docker but it can't find modules
I have already have docker image after build step and here's some information.
docker run --rm -v $(pwd):/code -v /code/node_modules -w /code $dockerBuilderImage npm run dist-admin-web
package.json
has a script of dist-admin-web
with rm -rf bin %% tsc
My docker file looks like
FROM node:12.18.2
COPY package.json ./
COPY package-lock.json ./
RUN npm install
(... some global installations)
As I said, when I do commands docker run
and it doesn't work! FYI, I have docker-compose for local development and it works with that image.
My docker compose is following... (I've deleted unneccessary information like env..)
webpack_dev_server:
build:
context: ./
dockerfile: Dockerfile
image: nodewebpack_ts:12.18.2-ts3.5.2
ports:
- "3000:3000"
volumes:
- ./:/ROOT/
- /ROOT/node_modules
working_dir: /ROOT
As I know, I have to add node_modules at volumes because of this. That's why docker compose works