-
Notifications
You must be signed in to change notification settings - Fork 255
/
Dockerfile2
27 lines (19 loc) · 746 Bytes
/
Dockerfile2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# BUILDING
FROM node:lts-alpine AS builder
WORKDIR /app
COPY . ./
# 这里可以做单独配置
# COPY docker/config.prod.ts ./src/config/config.prod.ts
# 国内可以打开下面一行加速,但有时候会出现503问题,暂时不用
# RUN npm config set registry https://registry.npm.taobao.org/ && npm config set sass-binary-site http://npm.taobao.org/mirrors/node-sass
RUN npm install && \
# npm install typescript -g && \
# npm run lint && \
npm run build
# nginx
FROM nginx:stable-alpine
MAINTAINER vueadmin
COPY --from=builder app/dist/ /usr/share/nginx/html/
# 自定义nginx.conf配置,比如history模式下,会404问题
RUN rm /etc/nginx/conf.d/default.conf
COPY docker/nginx.conf /etc/nginx/conf.d/