根据https://mp.weixin.qq.com/s/rxoq97YodwtAdTqKntuwMA的提示进行安装。
实际文件和代码如下:
pro.env文件的内容:
PYTHONPATH=${PYTHONPATH}:${PWD}
LL_M_USER="liuli"
LL_M_PASS="liuli"
LL_M_HOST="liuli_mongodb"
LL_M_PORT="27017"
LL_M_DB="admin"
LL_M_OP_DB="liuli"
LL_FLASK_DEBUG=0
LL_HOST="0.0.0.0"
LL_HTTP_PORT=8765
LL_WORKERS=1
# 上面这么多配置不用改,下面的才需要各自配置
# 请填写你的实际IP
LL_DOMAIN="http://172.17.0.1:8765"
# 请填写微信分发配置
LL_WECOM_ID="自定义"
LL_WECOM_AGENT_ID="自定义"
LL_WECOM_SECRET="自定义"
default.json
的内容如下:
{
"name": "default",
"author": "liuli_team",
"collector": {
"wechat_sougou": {
"wechat_list": [
"老胡的储物柜"
],
"delta_time": 5,
"spider_type": "playwright"
}
},
"processor": {
"before_collect": [],
"after_collect": [{
"func": "ad_marker",
"cos_value": 0.6
}, {
"func": "to_rss",
"link_source": "github"
}]
},
"sender": {
"sender_list": ["wecom"],
"query_days": 7,
"delta_time": 3
},
"backup": {
"backup_list": ["mongodb"],
"query_days": 7,
"delta_time": 3,
"init_config": {},
"after_get_content": [{
"func": "str_replace",
"before_str": "data-src=\"",
"after_str": "src=\"https://images.weserv.nl/?url="
}]
},
"schedule": {
"period_list": [
"00:10",
"12:10",
"21:10"
]
}
}
docker-compose.yml文件的内容如下:
version: "3"
services:
liuli_api:
image: liuliio/api:v0.1.3
restart: always
container_name: liuli_api
ports:
- "8765:8765"
volumes:
- ./pro.env:/data/code/pro.env
depends_on:
- liuli_mongodb
networks:
- liuli-network
liuli_schedule:
image: liuliio/schedule:v0.2.4
restart: always
container_name: liuli_schedule
volumes:
- ./pro.env:/data/code/pro.env
- ./liuli_config:/data/code/liuli_config
depends_on:
- liuli_mongodb
networks:
- liuli-network
liuli_mongodb:
image: mongo:3.6
restart: always
container_name: liuli_mongodb
environment:
- MONGO_INITDB_ROOT_USERNAME=liuli
- MONGO_INITDB_ROOT_PASSWORD=liuli
ports:
- "27027:27017"
volumes:
- ./mongodb_data:/data/db
command: mongod
networks:
- liuli-network
networks:
liuli-network:
driver: bridge
报错内容如下:
liuli_schedule | Loading .env environment variables...
liuli_schedule | Start schedule(pro) serve: PIPENV_DOTENV_LOCATION=./pro.env pipenv run python src/liuli_schedule.py
liuli_schedule | Loading .env environment variables...
liuli_schedule | Loading .env environment variables...
liuli_schedule | Start schedule(pro) serve: PIPENV_DOTENV_LOCATION=./pro.env pipenv run python src/liuli_schedule.py
liuli_schedule | Loading .env environment variables...
liuli_schedule | Loading .env environment variables...
liuli_schedule | Start schedule(pro) serve: PIPENV_DOTENV_LOCATION=./pro.env pipenv run python src/liuli_schedule.py
liuli_schedule | Loading .env environment variables...
liuli_schedule | Loading .env environment variables...
liuli_schedule | Start schedule(pro) serve: PIPENV_DOTENV_LOCATION=./pro.env pipenv run python src/liuli_schedule.py
liuli_schedule | Loading .env environment variables...
liuli_schedule | Loading .env environment variables...
liuli_schedule | Start schedule(pro) serve: PIPENV_DOTENV_LOCATION=./pro.env pipenv run python src/liuli_schedule.py
liuli_schedule | Loading .env environment variables...
liuli_schedule | Loading .env environment variables...
liuli_schedule | Start schedule(pro) serve: PIPENV_DOTENV_LOCATION=./pro.env pipenv run python src/liuli_schedule.py
liuli_schedule | Loading .env environment variables...
liuli_schedule | Loading .env environment variables...
liuli_schedule | Start schedule(pro) serve: PIPENV_DOTENV_LOCATION=./pro.env pipenv run python src/liuli_schedule.py
liuli_schedule | Loading .env environment variables...
liuli_schedule | Loading .env environment variables...
liuli_schedule | Start schedule(pro) serve: PIPENV_DOTENV_LOCATION=./pro.env pipenv run python src/liuli_schedule.py
liuli_schedule | Loading .env environment variables...
liuli_schedule exited with code 0
我感觉是python路径的问题。我的python路径是:
which python3 # /usr/bin/python3
我的VPS中没有${PYTHONPATH}这个系统变量:
echo ${PYTHONPATH} # NULL
请问大佬,我应该如何改正?