52 Star 200 Fork 126

tomsun28 / usthe

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Dockerfile 864 Bytes
一键复制 编辑 Web IDE 原始数据 按行查看 历史
tomsun28 提交于 2018-04-17 10:33 . docker test
# Stage 1, based on Node.js, to build and compile Angular
FROM node:8-alpine as builder
COPY package.json package-lock.json ./
RUN npm set progress=false && npm config set depth 0 && npm cache clean --force
## Storing node modules on a separate layer will prevent unnecessary npm installs at each build
RUN npm i && mkdir /ng-app && cp -R ./node_modules ./ng-app
WORKDIR /ng-app
COPY . .
RUN $(npm bin)/ng build --prod
# Stage 2, based on Nginx, to have only the compiled app, ready for production with Nginx
FROM nginx:1.13.3-alpine
COPY ./nginx/nginx-custom.conf /etc/nginx/conf.d/default.conf
## Remove default nginx website
RUN rm -rf /usr/share/nginx/html/*
## From ‘builder’ stage copy over the artifacts in dist folder to default nginx public folder
COPY --from=builder /ng-app/dist /usr/share/nginx/html
CMD ["nginx", "-g", "daemon off;"]
TypeScript
1
https://gitee.com/tomsun28/usthe.git
git@gitee.com:tomsun28/usthe.git
tomsun28
usthe
usthe
master

搜索帮助