我有一个用于angular项目的docker容器,使用node 18; Dockerfile:
FROM node:18
WORKDIR /app
COPY package*.json ./
RUN npm update
RUN npm install
COPY . .
EXPOSE 4200
CMD ["ng", "serve", "--host", "0.0.0.0", "--port", "4200"]
问题是,当我运行sudo docker-copmose build
时,它很好,但后来我try sudo docker-compose up
,它有一个错误:
可能未安装auralab-angular| node 程序包.try 安装 使用‘NPM Install’.AURALAB-ANGLING|错误:无法找到 构建器的 node 包:‘@arting-devkit/Build-Angular:dev-server’. Auralab-ANGING退出,代码为1
我正在使用Google-Cloud Unbuu机器,但我不知道错误原因. Docker-compose.yaml:
angular:
image: auralab-angular:latest
container_name: auralab-angular
build:
context: ./client
dockerfile: Dockerfile
volumes:
- ./client:/app
ports:
- "4200:4200"
command: ["ng", "serve", "--host", "0.0.0.0", "--port", "4200"]
depends_on:
- django
struct 为:
project:
|___client:
|_______Dockerfile
|_______other files;
|___docker-compose.yaml