服务角-CLI应用程式搬运工容器

问题描述 投票:0回答:1

所述角度image`s DockerFile

FROM node:8
MAINTAINER NG
EXPOSE 4200
RUN npm install
RUN npm install -g @angular/cli  

泊坞窗,compose.yml

version: '3'
services:
    node:
        image: ng-angular
        container_name: ng-angular1
        working_dir: /home/node
        ports: 
            - 4200:4200 

作为输出

* Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

Date: 2019-01-30T10:28:28.001Z
Hash: b43d4abc7ff424082a0f
Time: 13641ms
chunk {main} main.js, main.js.map (main) 11.5 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 236 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 16.4 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 3.75 MB [initial] [rendered]
ℹ 「wdm」: Compiled successfully.

我在想什么?我无法访问http://localhost:4200/

docker-compose angular-cli
1个回答
0
投票
  1. 看起来我需要以发布端口4200和节点的服务运行bash,以便使用docker-compose run -p 4200:4200 node bash
  2. 此外--host 0.0.0.0有作为论据ng serve命令传递。
© www.soinside.com 2019 - 2024. All rights reserved.