simple docker compose example

This commit is contained in:
Jokob-sk
2022-12-18 09:10:32 +11:00
parent ca9315314a
commit c29a8ed864

View File

@@ -83,6 +83,32 @@ Docker-compose examples can be found below.
### Example 1 ### Example 1
```yaml
version: "3"
services:
pialert:
container_name: pialert
image: "jokobsk/pi.alert:latest"
network_mode: "host"
restart: unless-stopped
volumes:
- local/path/pialert/config:/home/pi/pialert/config
- local/path/pialert/db/pialert.db:/home/pi/pialert/db/pialert.db
# (optional) map an empty file with the name 'setting_darkmode' if you want to force the dark mode on container rebuilt
- local/path/pialert/db/setting_darkmode:/home/pi/pialert/db/setting_darkmode
# (optional) useful for debugging if you have issues setting up the container
- local/path/logs:/home/pi/pialert/front/log
environment:
- TZ=Europe/Berlin
- HOST_USER_ID=1000
- HOST_USER_GID=1000
- PORT=20211
```
To run the container execute: `sudo docker-compose up -d`
### Example 2
`docker-compose.yml` `docker-compose.yml`
```yaml ```yaml
@@ -102,9 +128,9 @@ services:
- ${LOGS_LOCATION}:/home/pi/pialert/front/log - ${LOGS_LOCATION}:/home/pi/pialert/front/log
environment: environment:
- TZ=${TZ} - TZ=${TZ}
- PORT=${PORT}
- HOST_USER_ID=${HOST_USER_ID} - HOST_USER_ID=${HOST_USER_ID}
- HOST_USER_GID=${HOST_USER_GID} - HOST_USER_GID=${HOST_USER_GID}
- PORT=${PORT}
``` ```
`.env` file `.env` file
@@ -130,7 +156,7 @@ DEV_LOCATION=/path/to/local/source/code
To run the container execute: `sudo docker-compose --env-file /path/to/.env up` To run the container execute: `sudo docker-compose --env-file /path/to/.env up`
### Example 2 ### Example 3
Courtesy of [pbek](https://github.com/pbek). The volume `pialert_db` is used by the db directory. The two config files are mounted directly from a local folder to their places in the config folder. You can backup the `docker-compose.yaml` folder and the docker volumes folder. Courtesy of [pbek](https://github.com/pbek). The volume `pialert_db` is used by the db directory. The two config files are mounted directly from a local folder to their places in the config folder. You can backup the `docker-compose.yaml` folder and the docker volumes folder.