From 43b313dc63a189decf5778a4a691a3d3d801a187 Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Thu, 6 Jun 2019 07:38:37 +0800 Subject: [PATCH] updated Dockerfile --- Dockerfile | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8a9831b4..9fc53ede 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,27 +6,33 @@ ADD . /opt/crawlab # install python RUN apt-get update -RUN apt-get install -y python3 python3-pip net-tools iputils-ping git nginx curl +RUN apt-get install -y python3 python3-pip net-tools iputils-ping redis-server git nginx curl -# soft link +# python soft link RUN ln -s /usr/bin/pip3 /usr/local/bin/pip RUN ln -s /usr/bin/python3 /usr/local/bin/python +# install mongodb +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" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list +apt-get update +apt-get install -y mongodb-org + # install backend RUN pip install -U setuptools RUN pip install -r /opt/crawlab/crawlab/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple # install nvm -RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash -RUN export NVM_DIR="$HOME/.nvm" -RUN [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -RUN nvm install 8.12 -RUN nvm use 8.12 +#RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash +#RUN export NVM_DIR="$HOME/.nvm" +#RUN [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm +#RUN nvm install 8.12 +#RUN nvm use 8.12 # install frontend WORKDIR /opt/crawlab/frontend -RUN npm install -g yarn pm2 -RUN yarn install +#RUN npm install -g yarn pm2 +#RUN yarn install # nginx config & start frontend RUN cp /opt/crawlab/crawlab.conf /etc/nginx/conf.d @@ -34,6 +40,9 @@ RUN service nginx reload # start backend WORKDIR /opt/crawlab/crawlab -CMD pm2 start app.py -CMD pm2 start flower.py -CMD pm2 start worker.py +CMD python app.py +CMD python flower.py +CMD python worker.py +#CMD pm2 start app.py +#CMD pm2 start flower.py +#CMD pm2 start worker.py