mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-28 17:50:56 +01:00
添加各个节点的镜像制作
This commit is contained in:
20
examples/master/Dockerfile
Normal file
20
examples/master/Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
||||
FROM alpine:latest
|
||||
|
||||
# 配置工作目录
|
||||
WORKDIR /opt/crawlab
|
||||
|
||||
# 拷贝配置文件
|
||||
COPY config.yml /opt/crawlab/conf/config.yml
|
||||
|
||||
# 拷贝可执行文件
|
||||
COPY crawlab /usr/local/bin
|
||||
|
||||
# 创建spiders文件用于存放爬虫, 授权可执行文件
|
||||
RUN mkdir -p /opt/crawlab/spiders && chmod +x /usr/local/bin/crawlab
|
||||
|
||||
# 指定为Master节点
|
||||
ENV CRAWLAB_SERVER_MASTER Y
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["crawlab"]
|
||||
8
examples/master/README.md
Normal file
8
examples/master/README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# Master 节点镜像制作
|
||||
|
||||
在Dockerfile里面的二进制包,需要手动在源码目录下进行构建然后再放进来。
|
||||
|
||||
## Linux 二进制包构建
|
||||
```
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o crawlab main.go
|
||||
```
|
||||
32
examples/master/config.yml
Normal file
32
examples/master/config.yml
Normal file
@@ -0,0 +1,32 @@
|
||||
api:
|
||||
address: "localhost:8000"
|
||||
mongo:
|
||||
host: "192.168.235.26"
|
||||
port: 27017
|
||||
db: crawlab_local
|
||||
username: "root"
|
||||
password: "example"
|
||||
authSource: "admin"
|
||||
redis:
|
||||
address: 192.168.235.0
|
||||
password: redis-1.0
|
||||
database: 29
|
||||
port: 16379
|
||||
log:
|
||||
level: info
|
||||
path: "/logs/crawlab"
|
||||
server:
|
||||
host: 0.0.0.0
|
||||
port: 8000
|
||||
master: "Y"
|
||||
secret: "crawlab"
|
||||
register:
|
||||
# mac 或者 ip,如果是ip,则需要手动指定IP
|
||||
type: "mac"
|
||||
ip: "192.168.0.104"
|
||||
spider:
|
||||
path: "/spiders"
|
||||
task:
|
||||
workers: 4
|
||||
other:
|
||||
tmppath: "/tmp"
|
||||
Reference in New Issue
Block a user