mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
updated Dockerfile
This commit is contained in:
15
Dockerfile
15
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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user