updated Dockerfile

This commit is contained in:
Marvin Zhang
2019-06-09 19:38:35 +08:00
parent 6bebe0dd5d
commit d2baa3482f
2 changed files with 3 additions and 16 deletions

View File

@@ -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

View File

@@ -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