Привет, ребят, почему не запускается в docker контейнере
Vue?
docker run -it -d --name project_name -p 3001:8080 -v /home/username/PhpstormProjects/project_name/cabinet:/app username/project_name
Dockerfile:
FROM node:17.3-alpine
ARG APP_DIR=/app
ARG LOCAL_APP_PATH=cabinet
RUN mkdir -p ${APP_DIR}
WORKDIR ${APP_DIR}
COPY ${LOCAL_APP_PATH}/package*.json ./
RUN ls -al
RUN npm i;
EXPOSE 8080
CMD npm run serve
Данный фрагмент при сборке показывает, что
package.json присутствует
Step 7/10 :
RUN ls -al
---> Running in d9897f0ce6fa
total 492
drwxr-xr-x 1 root root 4096 Jan 12 07:42 .
drwxr-xr-x 1 root root 4096 Jan 12 07:42 ..
-rw-rw-r-- 1 root root 487553 Jan 12 07:42 package-lock.json
-rw-rw-r-- 1 root root 1397 Dec 22 12:25 package.json
docker ps -a
Отдает:
d57e7227eb10 username/project_name "docker-entrypoint.s…" 3 minutes ago Exited (254) 3 minutes ago project_name
Вбиваю:
docker logs d57e7227eb10
Получаю:
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /app/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/app/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-01-12T07_47_35_850Z-debug-0.log
При этом установка внутри протекает при сборке и сборка завершается без ошибок:
Step 8/11 : RUN npm i;
---> Running in 8d33e5110d59
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
...