I need to up a vue js app with docker-compose, but when docker trying 'npm install', the logs shows that npm cannot find a file package.json. Notice that i created a vue js project with vue js cli before i trying to up app with docker-compose* I verified if the directory is wrong, but i cannot see anything wrong . I'm running docker commands on vue project root. The docker-compose file is inside another project
My Dockefile:
FROM node:lts-alpine
RUN mkdir /globostore-frontend
WORKDIR /globostore-frontend
ENV PATH /globostore-frontend/node_modules/.bin:$PATH
COPY package.json /globostore-frontend
RUN npm install
RUN npm install -g @vue/cli
CMD ["npm", "run", "serve"]
My docker-compose.yml:
version: "3.8"
services:
db:
image: mysql:5.7
ports:
- '3306:3306'
environment:
MYSQL_DATABASE: 'Globostore'
MYSQL_USER: 'wendel'
MYSQL_PASSWORD: 'wendel12'
MYSQL_ROOT_PASSWORD: 'wendel12'
volumes:
- ./db:/docker-entrypoint-initdb.d/:ro
web:
build: .
command: flask run
volumes:
- .:/app
ports:
- '5000:5000'
depends_on:
- db
links:
- db
environment:
FLASK_ENV: development
bff:
build: ./../globostore-bff/
ports:
- 5001:5001
volumes:
- .:/app
environment:
FLASK_ENV: development
command: flask run
frontend:
build: ./../globostore-frontend/
volumes:
- .:/globostore-frontend
ports:
- 8080:8080
Error:
frontend_1 | npm ERR! code ENOENT
frontend_1 | npm ERR! syscall open
frontend_1 | npm ERR! path /globostore-frontend/package.json
frontend_1 | npm ERR! errno -2
frontend_1 | npm ERR! enoent ENOENT: no such file or directory, open '/globostore-frontend/package.json'
frontend_1 | npm ERR! enoent This is related to npm not being able to find a file.
frontend_1 | npm ERR! enoent
frontend_1 |
frontend_1 | npm ERR! A complete log of this run can be found in:
frontend_1 | npm ERR! /root/.npm/_logs/2021-02-02T17_00_23_137Z-debug.log
This is my project directory structure
I start the application through the docker-compose file at globostore-api directory

docker buildpackage.jsononglobostore-apidirectory. On Dockerfile you haveCOPY package.json /globostore-frontend