From d2baa3482fbcfcbf0d746ef36b886c79944d389f Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Sun, 9 Jun 2019 19:38:35 +0800 Subject: [PATCH] updated Dockerfile --- Dockerfile | 15 +-------------- docker-compose.yml | 4 ++-- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 688bb2ea..0f5c2917 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,19 +14,12 @@ ADD . /opt/crawlab # install python RUN apt-get update -RUN apt-get install -y python3 python3-pip net-tools iputils-ping redis-server git nginx ntp curl +RUN apt-get install -y python3 python3-pip net-tools iputils-ping git nginx ntp curl # 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 -RUN echo "Asia/Shanghai" > /etc/timezone && dpkg-reconfigure -f noninteractive tzdata -RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4 -RUN 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 -RUN apt-get update -RUN apt-get install -y mongodb-org - # install backend RUN pip install -U setuptools -i https://pypi.tuna.tsinghua.edu.cn/simple RUN pip install -r /opt/crawlab/crawlab/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple @@ -48,12 +41,6 @@ RUN cd /opt/crawlab/frontend && $NVM_DIR/v$NODE_VERSION/bin/yarn install RUN cp $WORK_DIR/crawlab.conf /etc/nginx/conf.d RUN service nginx reload -# start mongodb -CMD mongod - -# start redis -CMD redis-server - # start backend WORKDIR /opt/crawlab/crawlab CMD python $WORK_DIR/crawlab/app.py diff --git a/docker-compose.yml b/docker-compose.yml index fe2bfb78..088fdbb8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,11 +1,11 @@ version: '3.3' # 表示该 Docker-Compose 文件使用的是 Version 2 file services: - web: # 指定服务名称 + app: # 指定服务名称 build: . # 指定 Dockerfile 所在路径 ports: # 指定端口映射 - "5001:5000" task: - image: crawlab:v3 + image: crawlab:latest db: image: mongo restart: always