代码拉取完成,页面将自动刷新
# Usage (given build times depend on machine):
#
# Build SMALL image (no cache; ~20MB, time for build=rebuild = ~360s):
# docker build --squash="true" -t angular-starter .
#
# Build FAST (rebuild) image (cache; >280MB, build time ~360s, rebuild time ~80s):
# docker build -t angular-starter .
#
# Clean (remove intermidiet images):
# docker rmi -f $(docker images -f "dangling=true" -q)
#
# Run image (on localhost:8080):
# docker run --name angular-starter -p 8080:80 angular-starter &
#
# Run image as virtual host (read more: https://github.com/jwilder/nginx-proxy):
# docker run -e VIRTUAL_HOST=angular-starter.your-domain.com --name angular-starter angular-starter &
FROM nginx:1.13.0-alpine
# install console and node
RUN apk add --no-cache bash=4.3.46-r5 &&\
apk add --no-cache openssl=1.0.2k-r0 &&\
apk add --no-cache nodejs
# install npm ( in separate dir due to docker cache)
ADD package.json /tmp/npm_inst/package.json
RUN cd /tmp/npm_inst &&\
npm install &&\
mkdir -p /tmp/app &&\
mv /tmp/npm_inst/node_modules /tmp/app/
# build and publish application
ADD . /tmp/app
RUN cd /tmp/app &&\
npm run build:aot &&\
mv ./dist/* /usr/share/nginx/html/
# clean
RUN rm -Rf /tmp/npm_inst &&\
rm -Rf /tmp/app &&\
rm -Rf /root/.npm &&\
apk del nodejs
# this is for virtual host purposes
EXPOSE 80
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。