增加容器启动入口文件,整理参数配置数据
This commit is contained in:
52
docker/example/docker-compose.yml
Normal file
52
docker/example/docker-compose.yml
Normal file
@ -0,0 +1,52 @@
|
||||
jd_scripts:
|
||||
image: akyakya/jd_scripts
|
||||
container_name: jd_scripts
|
||||
restart: always
|
||||
#如果需要自定定义定时任务的需要自己写好`my_crontab_list.sh`文件 ,取消下面的挂载注释 ,通过 `volumes`挂载进去。
|
||||
volumes:
|
||||
# - ./my_crontab_list.sh:/scripts/docker/my_crontab_list.sh
|
||||
- ./logs:/scripts/logs
|
||||
tty: true
|
||||
environment:
|
||||
# 注意环境变量填写值的时候一律不需要引号(""或者'')下面这些只是事例,根据自己的需求增加删除
|
||||
#jd cookies
|
||||
# 例: JD_COOKIE=pt_key=XXX;pt_pin=XXX
|
||||
- JD_COOKIE=
|
||||
#微信server酱通
|
||||
- PUSH_KEY=
|
||||
#Bark App通知
|
||||
- BARK_PUSH=
|
||||
#telegram机器人通知
|
||||
- TG_BOT_TOKEN=
|
||||
- TG_USER_ID=
|
||||
#钉钉机器人通知
|
||||
- DD_BOT_TOKEN=
|
||||
- DD_BOT_SECRET=
|
||||
#京东种豆得豆
|
||||
- PLANT_BEAN_SHARECODES=
|
||||
#京东农场
|
||||
# 例: FRUITSHARECODES=京东农场的互助码
|
||||
- FRUITSHARECODES=
|
||||
#京东萌宠
|
||||
# 例: PETSHARECODES=东东萌宠的互助码
|
||||
- PETSHARECODES=
|
||||
# 宠汪汪的喂食数量
|
||||
- JOY_FEED_COUNT=
|
||||
#京小超
|
||||
# - SUPERMARKET_SHARECODES=
|
||||
#兑换多少数量的京豆(20,或者1000京豆,或者其他奖品的文字)
|
||||
# 例: MARKET_COIN_TO_BEANS=1000
|
||||
- MARKET_COIN_TO_BEANS=
|
||||
#是否开启debug模式打印日志
|
||||
# 例: JD_DEBUG=false
|
||||
- JD_DEBUG=
|
||||
#如果使用自定义定时任务,取消下面一行的注释
|
||||
#- CRONTAB_LIST_FILE=my_crontab_list.sh
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
#crontab /scripts/docker/my_crontab_list.sh #如果挂载了自定义任务文件,取消此条注释即可
|
||||
crond
|
||||
git -C /scripts/ pull
|
||||
node
|
123
docker/example/docker多账户使用独立容器使用说明.md
Normal file
123
docker/example/docker多账户使用独立容器使用说明.md
Normal file
@ -0,0 +1,123 @@
|
||||
### 使用此方式,请先理解学会使用[docker办法一](https://github.com/lxk0301/jd_scripts/tree/master/docker#%E5%88%9B%E5%BB%BA%E4%B8%80%E4%B8%AA%E7%9B%AE%E5%BD%95jd_scripts%E7%94%A8%E4%BA%8E%E5%AD%98%E6%94%BE%E5%A4%87%E4%BB%BD%E9%85%8D%E7%BD%AE%E7%AD%89%E6%95%B0%E6%8D%AE%E8%BF%81%E7%A7%BB%E9%87%8D%E8%A3%85%E7%9A%84%E6%97%B6%E5%80%99%E5%8F%AA%E9%9C%80%E8%A6%81%E5%A4%87%E4%BB%BD%E6%95%B4%E4%B8%AAjd_scripts%E7%9B%AE%E5%BD%95%E5%8D%B3%E5%8F%AF)的使用方式
|
||||
> 发现有人好像希望不同账户任务并发执行,不想一个账户执行完了才能再执行另一个,这里写一个`docker办法一`的基础上实现方式,其实就是不同账户创建不同的容器,他们互不干扰单独定时执行自己的任务。
|
||||
配置使用起来还是比较简单的,具体往下看
|
||||
### 文件夹目录参考
|
||||

|
||||
### 具体使用说明直接在图片标注了,文件参考[图片下方](https://github.com/lxk0301/jd_scripts/new/master/docker#docker-composeyml%E6%96%87%E4%BB%B6%E5%8F%82%E8%80%83),配置完成后的[执行命令]()
|
||||

|
||||
#### `docker-compose.yml`文件参考
|
||||
```yaml
|
||||
version: '3'
|
||||
services:
|
||||
jd_scripts1:
|
||||
image: akyakya/jd_scripts
|
||||
restart: always
|
||||
container_name: jd_scripts1
|
||||
tty: true
|
||||
volumes:
|
||||
- ./logs1:/scripts/logs
|
||||
environment:
|
||||
- JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5;
|
||||
- TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ
|
||||
- TG_USER_ID=12xxxx206
|
||||
- CRONTAB_LIST_FILE=crontab_list.sh
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
git -C /scripts/ pull
|
||||
crond
|
||||
node
|
||||
jd_scripts2:
|
||||
image: akyakya/jd_scripts
|
||||
restart: always
|
||||
container_name: jd_scripts2
|
||||
tty: true
|
||||
volumes:
|
||||
- ./logs2:/scripts/logs
|
||||
environment:
|
||||
- JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5;
|
||||
- TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ
|
||||
- TG_USER_ID=12xxxx206
|
||||
- CRONTAB_LIST_FILE=crontab_list.sh
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
git -C /scripts/ pull
|
||||
crond
|
||||
node
|
||||
jd_scripts3:
|
||||
image: akyakya/jd_scripts
|
||||
restart: always
|
||||
container_name: jd_scripts3
|
||||
tty: true
|
||||
volumes:
|
||||
- ./logs3:/scripts/logs
|
||||
- ./my_crontab_list3.sh:/scripts/docker/my_crontab_list.sh
|
||||
environment:
|
||||
- JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5;
|
||||
- TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ
|
||||
- TG_USER_ID=12xxxx206
|
||||
- CRONTAB_LIST_FILE=my_crontab_list.sh
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
crontab /scripts/docker/my_crontab_list.sh
|
||||
git -C /scripts/ pull
|
||||
crond
|
||||
node
|
||||
jd_scripts4:
|
||||
image: akyakya/jd_scripts
|
||||
restart: always
|
||||
container_name: jd_scripts4
|
||||
tty: true
|
||||
volumes:
|
||||
- ./logs4:/scripts/logs
|
||||
- ./my_crontab_list4.sh:/scripts/docker/my_crontab_list.sh
|
||||
environment:
|
||||
- JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5;
|
||||
- TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ
|
||||
- TG_USER_ID=12xxxx206
|
||||
- CRONTAB_LIST_FILE=my_crontab_list.sh
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
crontab /scripts/docker/my_crontab_list.sh
|
||||
git -C /scripts/ pull
|
||||
crond
|
||||
node
|
||||
jd_scripts5:
|
||||
image: akyakya/jd_scripts
|
||||
restart: always
|
||||
container_name: jd_scripts5
|
||||
tty: true
|
||||
volumes:
|
||||
- ./logs5:/scripts/logs
|
||||
- ./my_crontab_list5.sh:/scripts/docker/my_crontab_list.sh
|
||||
environment:
|
||||
- JD_COOKIE=pt_key=AAJfjaNrADAS8ygfgIsOxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxxx5;
|
||||
- TG_BOT_TOKEN=130xxxx280:AAExxxxxxWP10zNf91WQ
|
||||
- TG_USER_ID=12xxxx206
|
||||
- CRONTAB_LIST_FILE=my_crontab_list.sh
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
crontab /scripts/docker/my_crontab_list.sh
|
||||
git -C /scripts/ pull
|
||||
crond
|
||||
node
|
||||
```
|
||||
#### 目录文件配置好之后在 `jd_scripts_multi`目录执行
|
||||
`docker-compose up -d` 启动;
|
||||
`docker-compose logs` 打印日志;
|
||||
`docker-compose pull` 更新镜像;
|
||||
`docker-compose stop` 停止容器;
|
||||
`docker-compose restart` 重启容器;
|
||||
`docker-compose down` 停止并删除容器;
|
||||

|
||||
|
||||
|
65
docker/example/jd_scripts.my_crontab_list.syno.json
Normal file
65
docker/example/jd_scripts.my_crontab_list.syno.json
Normal file
@ -0,0 +1,65 @@
|
||||
{
|
||||
"cap_add" : [],
|
||||
"cap_drop" : [],
|
||||
"cmd" : "/bin/sh -c 'crontab /scripts/docker/my_crontab_list.sh && crond && node'",
|
||||
"cpu_priority" : 50,
|
||||
"devices" : null,
|
||||
"enable_publish_all_ports" : false,
|
||||
"enable_restart_policy" : true,
|
||||
"enabled" : true,
|
||||
"env_variables" : [
|
||||
{
|
||||
"key" : "PATH",
|
||||
"value" : "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
},
|
||||
{
|
||||
"key" : "CDN_JD_DAILYBONUS",
|
||||
"value" : "true"
|
||||
},
|
||||
{
|
||||
"key" : "JD_COOKIE",
|
||||
"value" : "pt_key=xxx;pt_pin=xxx;"
|
||||
},
|
||||
{
|
||||
"key" : "PUSH_KEY",
|
||||
"value" : ""
|
||||
},
|
||||
{
|
||||
"key" : "CRONTAB_LIST_FILE",
|
||||
"value" : "my_crontab_list.sh"
|
||||
}
|
||||
],
|
||||
"exporting" : false,
|
||||
"id" : "3a2f6f27c23f93bc104585c22569c760cc9ce82df09cdb41d53b491fe1d0341c",
|
||||
"image" : "akyakya/jd_scripts",
|
||||
"is_ddsm" : false,
|
||||
"is_package" : false,
|
||||
"links" : [],
|
||||
"memory_limit" : 0,
|
||||
"name" : "jd_scripts",
|
||||
"network" : [
|
||||
{
|
||||
"driver" : "bridge",
|
||||
"name" : "bridge"
|
||||
}
|
||||
],
|
||||
"network_mode" : "default",
|
||||
"port_bindings" : [],
|
||||
"privileged" : false,
|
||||
"shortcut" : {
|
||||
"enable_shortcut" : false
|
||||
},
|
||||
"use_host_network" : false,
|
||||
"volume_bindings" : [
|
||||
{
|
||||
"host_volume_file" : "/docker/jd_scripts/my_crontab_list.sh",
|
||||
"mount_point" : "/scripts/docker/my_crontab_list.sh",
|
||||
"type" : "rw"
|
||||
},
|
||||
{
|
||||
"host_volume_file" : "/docker/jd_scripts/logs",
|
||||
"mount_point" : "/scripts/logs",
|
||||
"type" : "rw"
|
||||
}
|
||||
]
|
||||
}
|
83
docker/example/jd_scripts.syno.json
Normal file
83
docker/example/jd_scripts.syno.json
Normal file
@ -0,0 +1,83 @@
|
||||
{
|
||||
"cap_add" : null,
|
||||
"cap_drop" : null,
|
||||
"cmd" : "/bin/sh -c 'crond && node'",
|
||||
"cpu_priority" : 0,
|
||||
"devices" : null,
|
||||
"enable_publish_all_ports" : false,
|
||||
"enable_restart_policy" : true,
|
||||
"enabled" : false,
|
||||
"env_variables" : [
|
||||
{
|
||||
"key" : "PATH",
|
||||
"value" : "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
},
|
||||
{
|
||||
"key" : "CDN_JD_DAILYBONUS",
|
||||
"value" : "true"
|
||||
},
|
||||
{
|
||||
"key" : "JD_COOKIE",
|
||||
"value" : "pt_key=AAJfjaNrADASxxxxxxxKpfDaZ2pSBOYTxtPqLK8U1Q;pt_pin=lxxxxx5;"
|
||||
},
|
||||
{
|
||||
"key" : "TG_BOT_TOKEN",
|
||||
"value" : "13xxxxxx80:AAEkNxxxxxxzNf91WQ"
|
||||
},
|
||||
{
|
||||
"key" : "TG_USER_ID",
|
||||
"value" : "12xxxx206"
|
||||
},
|
||||
{
|
||||
"key" : "PLANT_BEAN_SHARECODES",
|
||||
"value" : ""
|
||||
},
|
||||
{
|
||||
"key" : "FRUITSHARECODES",
|
||||
"value" : ""
|
||||
},
|
||||
{
|
||||
"key" : "PETSHARECODES",
|
||||
"value" : ""
|
||||
},
|
||||
{
|
||||
"key" : "SUPERMARKET_SHARECODES",
|
||||
"value" : ""
|
||||
},
|
||||
{
|
||||
"key" : "CRONTAB_LIST_FILE",
|
||||
"value" : "crontab_list.sh"
|
||||
}
|
||||
],
|
||||
"exporting" : false,
|
||||
"id" : "18af38bc0ac37a40e4b9608a86fef56c464577cc160bbdddec90155284fcf4e5",
|
||||
"image" : "akyakya/jd_scripts",
|
||||
"is_ddsm" : false,
|
||||
"is_package" : false,
|
||||
"links" : [],
|
||||
"memory_limit" : 0,
|
||||
"name" : "jd_scripts",
|
||||
"network" : [
|
||||
{
|
||||
"driver" : "bridge",
|
||||
"name" : "bridge"
|
||||
}
|
||||
],
|
||||
"network_mode" : "default",
|
||||
"port_bindings" : [],
|
||||
"privileged" : false,
|
||||
"shortcut" : {
|
||||
"enable_shortcut" : false,
|
||||
"enable_status_page" : false,
|
||||
"enable_web_page" : false,
|
||||
"web_page_url" : ""
|
||||
},
|
||||
"use_host_network" : false,
|
||||
"volume_bindings" : [
|
||||
{
|
||||
"host_volume_file" : "/docker/jd_scripts/logs",
|
||||
"mount_point" : "/scripts/logs",
|
||||
"type" : "rw"
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user