你好,我有以下安装泊坞窗:
docker-compose.yml:
version: "3"
services:
micro-hr:
build: ./backend/micro-hr
entrypoint: ./backend/micro-hr/.docker/entrypoint.sh
container_name: micro-hr
environment:
- CHOKIDAR_USEPOLLING=true
ports:
- 3001:3000
volumes:
- .:/home/node/app
dockerfile:
FROM node:12.14.0-alpine3.11
RUN apk add --no-cache bash git
RUN touch /home/node/.bashrc | echo "PS1='\w\$ '" >> /home/node/.bashrc
RUN npm config set cache /home/node/app/.npm-cache --global
WORKDIR /home/node/app
COPY --chown=node:node . ./
COPY package*.json .env ./
USER node
和 entrypoint.sh
#!/bin/bash
npm config set cache /home/node/app/.npm-cache --global
cd /home/node/app
npm install
npm run start:dev
但是我在docker-compose up上遇到了这个错误:
micro-hr | npm WARN saveError ENOENT: no such file or directory, open '/home/node/app/package.json'
micro-hr | npm WARN enoent ENOENT: no such file or directory, open '/home/node/app/package.json'
micro-hr | npm WARN app No description
micro-hr | npm WARN app No repository field.
micro-hr | npm WARN app No README data
micro-hr | npm WARN app No license field.
micro-hr |
micro-hr | up to date in 1.154s
micro-hr | found 0 vulnerabilities
micro-hr |
micro-hr | npm ERR! code ENOENT
micro-hr | npm ERR! syscall open
micro-hr | npm ERR! path /home/node/app/package.json
micro-hr | npm ERR! errno -2
micro-hr | npm ERR! enoent ENOENT: no such file or directory, open '/home/node/app/package.json'
micro-hr | npm ERR! enoent This is related to npm not being able to find a file.
micro-hr | npm ERR! enoent
micro-hr |
micro-hr | npm ERR! A complete log of this run can be found in:
micro-hr | npm ERR! /home/node/app/.npm-cache/_logs/2020-09-01T01_00_33_229Z-debug.log
我怀疑它与节点用户有关,但是我没有进行测试,也没有 我通过docker-compose日志得到了这一点。
答案 0 :(得分:1)
您的docker-compose.yml说
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<overlayable name="Test">
<policy type="public">
<item type="xml" name="my_config"/>
</policy>
</overlayable>
</resources>
删除这两行,在本地构建应用程序(不使用Docker),并且仅在部署Docker映像时构建。