mirror of
https://github.com/wallabag/docker
synced 2025-12-13 09:46:27 +00:00
Add healthcheck and dependencies to docker-compose example
This PR adds in a health check that can used for reporting, monitoring, or autohealing, as well as a `depends_on` statement that ensures wallabag comes up only once the DB and Redis are up. Update timeout/retries to be more sane
This commit is contained in:
committed by
sethsimmons
parent
1b5fe1a934
commit
05d9d45a54
17
README.md
17
README.md
@@ -107,7 +107,7 @@ $ docker exec -t NAME_OR_ID_OF_YOUR_WALLABAG_CONTAINER /var/www/wallabag/bin/con
|
|||||||
|
|
||||||
## docker-compose
|
## docker-compose
|
||||||
|
|
||||||
It's a good way to use [docker-compose](https://docs.docker.com/compose/). Example:
|
An example [docker-compose](https://docs.docker.com/compose/) file can be seen below:
|
||||||
|
|
||||||
```
|
```
|
||||||
version: '3'
|
version: '3'
|
||||||
@@ -133,14 +133,29 @@ services:
|
|||||||
- "80"
|
- "80"
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/wallabag/images:/var/www/wallabag/web/assets/images
|
- /opt/wallabag/images:/var/www/wallabag/web/assets/images
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "wget" ,"--no-verbose", "--tries=1", "--spider", "http://localhost"]
|
||||||
|
interval: 1m
|
||||||
|
timeout: 3s
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
- redis
|
||||||
db:
|
db:
|
||||||
image: mariadb
|
image: mariadb
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=wallaroot
|
- MYSQL_ROOT_PASSWORD=wallaroot
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/wallabag/data:/var/lib/mysql
|
- /opt/wallabag/data:/var/lib/mysql
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
|
||||||
|
interval: 20s
|
||||||
|
timeout: 3s
|
||||||
redis:
|
redis:
|
||||||
image: redis:alpine
|
image: redis:alpine
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
|
interval: 20s
|
||||||
|
timeout: 3s
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that you must fill out the mail related variables according to your mail config.
|
Note that you must fill out the mail related variables according to your mail config.
|
||||||
|
|||||||
Reference in New Issue
Block a user