Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
chore(docker): imp healthcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
hldh214 committed Mar 31, 2022
1 parent 2e6cd43 commit 004d8a0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 74 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
!Pipfile
!Pipfile.lock
!lokbot
!docker-healthcheck.sh
!config.example.json
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ RUN pip install -i ${PYPI_MIRROR} pipenv && \
ENV PATH="/app/.venv/bin:$PATH"

HEALTHCHECK --retries=1 \
CMD ./docker-healthcheck.sh
CMD if grep -q Exception /app/output.log; then exit 1; else exit 0; fi

ENTRYPOINT ["/bin/sh", "-c", "python -m lokbot $TOKEN $CAPTCHA_SOLVER_CONFIG 2>&1 | tee output.log"]
75 changes: 4 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pipenv run python -m lokbot YOUR_X_ACCESS_TOKEN
### Build image yourself

```shell
docker build -t lok_bot_local --build-arg PYPI_MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple .
docker buildx build -t lok_bot_local --build-arg PYPI_MIRROR=https://pypi.tuna.tsinghua.edu.cn/simple .
docker run -e TOKEN=YOUR_X_ACCESS_TOKEN lok_bot_local
```

Expand All @@ -101,27 +101,11 @@ docker run -e TOKEN=YOUR_X_ACCESS_TOKEN ghcr.io/hldh214/lok_bot
"jobs": [
{
// name, DO NOT change
"name": "hospital_recover",
// or false to disable this job
"enabled": true,
// Run every 90 to 180 minutes.
"interval": {
"start": 90,
"end": 180
}
},
{
"name": "wall_repair",
"enabled": true,
"interval": {
"start": 30,
"end": 90
}
},
{
"name": "alliance_farmer",
// or false to disable this job
"enabled": true,
"kwargs": {
// or false to disable gift claiming
"gift_claim": true,
"help_all": true,
"research_donate": true,
Expand All @@ -131,51 +115,12 @@ docker run -e TOKEN=YOUR_X_ACCESS_TOKEN ghcr.io/hldh214/lok_bot
10101008
]
},
// Run every 120 to 200 minutes.
"interval": {
"start": 120,
"end": 200
}
},
{
"name": "mail_claim",
"enabled": true,
"interval": {
"start": 120,
"end": 200
}
},
{
"name": "caravan_farmer",
"enabled": true,
"interval": {
"start": 120,
"end": 200
}
},
{
"name": "use_resource_in_item_list",
"enabled": true,
"interval": {
"start": 120,
"end": 200
}
},
{
"name": "vip_chest_claim",
"enabled": true,
"interval": {
"start": 120,
"end": 200
}
},
{
"name": "harvester",
"enabled": true,
"interval": {
"start": 10,
"end": 20
}
},
{
// experimental
"name": "socf_thread",
Expand All @@ -200,14 +145,6 @@ docker run -e TOKEN=YOUR_X_ACCESS_TOKEN ghcr.io/hldh214/lok_bot
"threads": [
{
// name, DO NOT change
"name": "free_chest_farmer_thread",
"enabled": true
},
{
"name": "quest_monitor_thread",
"enabled": true
},
{
"name": "building_farmer_thread",
"enabled": true,
"kwargs": {
Expand All @@ -222,10 +159,6 @@ docker run -e TOKEN=YOUR_X_ACCESS_TOKEN ghcr.io/hldh214/lok_bot
// 8 for TASK_CODE_GOLD_HAMMER if you're vip5 or above
"task_code": 8
}
},
{
"name": "academy_farmer_thread",
"enabled": true
}
]
}
Expand Down
1 change: 0 additions & 1 deletion docker-healthcheck.sh

This file was deleted.

0 comments on commit 004d8a0

Please sign in to comment.