* 增加Docker开发环境

* 更新Dockerfile构建文件,升级NodeJS依赖版本。
 * 遵循ESLint重新格式化代码,修复部分警告
 * 登录Token失效增加登出提示
 * 网络请求问题增加错误错误提示
 * 升级UI依赖库
This commit is contained in:
yaziming
2020-06-19 16:57:00 +08:00
parent e7ff02589b
commit aeaa4493a7
129 changed files with 18222 additions and 14180 deletions

View File

@@ -1,4 +1,4 @@
FROM golang:1.13 AS backend-build
FROM golang:latest AS backend-build
WORKDIR /go/src/app
COPY ./backend .
@@ -8,16 +8,16 @@ ENV GOPROXY https://goproxy.io
RUN go install -v ./...
FROM node:8.16.0-alpine AS frontend-build
FROM node:latest AS frontend-build
ADD ./frontend /app
WORKDIR /app
# install frontend
RUN npm config set unsafe-perm true
RUN npm install -g yarn && yarn install
#RUN npm config set unsafe-perm true
#RUN npm install -g yarn && yarn install
RUN npm run build:prod
RUN yarn install && yarn run build:prod
# images
FROM ubuntu:latest
@@ -31,19 +31,21 @@ ENV CRAWLAB_IS_DOCKER Y
# install packages
RUN chmod 777 /tmp \
&& apt-get update \
&& apt-get install -y curl git net-tools iputils-ping ntp ntpdate python3 python3-pip nginx wget \
&& apt-get install -y curl git net-tools iputils-ping ntp ntpdate python3 python3-pip nginx wget dumb-init \
&& ln -s /usr/bin/pip3 /usr/local/bin/pip \
&& ln -s /usr/bin/python3 /usr/local/bin/python
# install dumb-init
RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.2/dumb-init_1.2.2_amd64
RUN chmod +x /usr/local/bin/dumb-init
# install backend
RUN pip install scrapy pymongo bs4 requests crawlab-sdk scrapy-splash
# add files
ADD . /app
COPY ./backend/conf /app/backend/conf
COPY ./backend/data /app/backend/data
COPY ./backend/scripts /app/backend/scripts
COPY ./backend/template /app/backend/template
COPY ./nginx /app/nginx
COPY ./docker_init.sh /app/docker_init.sh
# copy backend files
RUN mkdir -p /opt/bin