From 2a9303f459b860fd6a0a3338d185783f0b1c9d76 Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Tue, 11 Jun 2019 21:45:54 +0800 Subject: [PATCH 1/2] updated Dockerfile --- Dockerfile | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index ec67bd6d..8559e422 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,20 +14,12 @@ ENV WORK_DIR /opt/crawlab # install pkg RUN apt-get update \ - && apt-get install -y curl git net-tools iputils-ping ntp gnupg2 nginx redis python python3 python3-pip \ + && apt-get install -y curl git net-tools iputils-ping ntp nginx python3 python3-pip \ && apt-get clean \ && cp $WORK_DIR/crawlab.conf /etc/nginx/conf.d \ && ln -s /usr/bin/pip3 /usr/local/bin/pip \ && ln -s /usr/bin/python3 /usr/local/bin/python -# install mongodb -RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4 \ - && echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.0.list \ - && apt-get update \ - && apt-get install -y mongodb-org \ - && apt-get clean \ - && mkdir -p /data/db - # install nvm RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.24.0/install.sh | bash \ && . $NVM_DIR/nvm.sh \ From bd2f8f343b8882034efeca3f4c07d7acf956ac50 Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Tue, 11 Jun 2019 21:58:50 +0800 Subject: [PATCH 2/2] updated Dockerfile --- Dockerfile | 2 +- docker_init.sh | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8559e422..6fdb5142 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,7 @@ ENV NODE_PATH $NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH # install frontend -RUN npm install -g yarn pm2 --registry=https://registry.npm.taobao.org \ +RUN npm install -g yarn --registry=https://registry.npm.taobao.org \ && cd /opt/crawlab/frontend \ && yarn install --registry=https://registry.npm.taobao.org diff --git a/docker_init.sh b/docker_init.sh index 59208c8e..7298613c 100755 --- a/docker_init.sh +++ b/docker_init.sh @@ -3,9 +3,7 @@ case $1 in master) cd /opt/crawlab/frontend \ && npm run build:prod \ - && service nginx start \ - && mongod --fork --logpath /var/log/mongod.log - redis-server >> /var/log/redis-server.log 2>&1 & + && service nginx start python $WORK_DIR/crawlab/flower.py >> /opt/crawlab/flower.log 2>&1 & python $WORK_DIR/crawlab/worker.py >> /opt/crawlab/worker.log 2>&1 & python $WORK_DIR/crawlab/app.py