I am trying to wire up my Angular 7 client app into docker compose locally.
I get the following error when I docker-compose up:
client-app | npm ERR! errno -2
client-app | npm ERR! syscall open
client-app | npm ERR! enoent ENOENT: no such file or directory, open '/app/package.json'
Dockerfile:
FROM node:9.6.1
RUN mkdir -p /app
WORKDIR /app
EXPOSE 4200
ENV PATH /app/node_modules/.bin:$PATH
COPY . /app
RUN npm install --silent
RUN npm rebuild node-sass
CMD ["npm", "run", "docker-start"]
The compose part for the client is:
client-app:
image: ${DOCKER_REGISTRY-}client
container_name: client-app
ports:
- "4200:81"
build:
context: .
dockerfile: ClientApp/Dockerfile
package.json is in the ClientApp folder along-side Dockerfile, I would assume COPY . /app should copy the package.json to the container. I don't have any excludes in dockerignore. I am using Docker for Windows with Unix containers. I tried npm init before (but that will create an empty package.json anyway) and looked through the SO posts but most of the dockerfile definitions look exactly the same. I also tried: COPY package*.json ./ additionally and building the image with --no-cache.