added Dockerfiles

This commit is contained in:
Marvin Zhang
2019-08-16 00:09:04 +08:00
parent a1c45cb5de
commit 7aa6afb4b5
5 changed files with 54 additions and 14 deletions

View File

@@ -1,10 +1,20 @@
FROM node:8.16.0-alpine AS build
ADD ./frontend /app
WORKDIR /app
# install frontend
RUN npm install -g yarn && yarn install
RUN npm run build:prod
FROM alpine:latest
# 安装nginx
RUN mkdir /run/nginx && apk add nginx
# 拷贝编译文件
COPY dist /app/dist
COPY --from=build /app/dist /app/dist
# 拷贝nginx代理文件
COPY crawlab.conf /etc/nginx/conf.d