update
This commit is contained in:
parent
6997806960
commit
4d1f79e0fb
|
@ -2,97 +2,19 @@
|
|||
|
||||
###### guide-by-example
|
||||
|
||||
![logo](https://i.imgur.com/GrWPooR.png)
|
||||
![logo](https://i.imgur.com/6SIoRWX.png)
|
||||
|
||||
|
||||
# Purpose
|
||||
# Overview
|
||||
|
||||
For me to wrap head around some shit.
|
||||
Notes for troubleshooting.
|
||||
Docker is a container technology that utilizes the host OS's kernel while putting the userland applications into a sandbox.
|
||||
It is more lightweight than a full-fledged virtual machine, but you're applications need to be compatible with the host OS.
|
||||
|
||||
What was at one time tested and should 100% work.
|
||||
Compose is a Docker tool that allows defining containers using a YAML file and run them with a single command.
|
||||
|
||||
# docker-compose
|
||||
The purpose of docker and docker-compose is either development or deployment.<br>
|
||||
Most of the stuff around here is about deployment, how to deploy others people work<br>
|
||||
|
||||
`docker-compose.yml`
|
||||
```yml
|
||||
services:
|
||||
|
||||
whoami:
|
||||
image: "containous/whoami"
|
||||
container_name: "whoami"
|
||||
hostname: "whoami"
|
||||
ports:
|
||||
- "80:80"
|
||||
```
|
||||
# Basics
|
||||
|
||||
|
||||
|
||||
# Scheduling and cron issues
|
||||
|
||||
The default docker-compose deployment uses cron container.<br>
|
||||
Problem is it does not work, so Ofelia is used.<br>
|
||||
[Here](https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/ofelia)
|
||||
is guide how to set it up.
|
||||
|
||||
Bellow is Ofelia's config file for discovery and ping check of live hosts.
|
||||
|
||||
`config.ini`
|
||||
```ini
|
||||
[job-exec "phpipam ping"]
|
||||
schedule = @every 10m
|
||||
container = phpipam-web
|
||||
command = /usr/bin/php /phpipam/functions/scripts/pingCheck.php
|
||||
|
||||
[job-exec "phpipam discovery"]
|
||||
schedule = @every 25m
|
||||
container = phpipam-web
|
||||
command = /usr/bin/php /phpipam/functions/scripts/discoveryCheck.php
|
||||
```
|
||||
|
||||
# Reverse proxy
|
||||
|
||||
Caddy v2 is used, details
|
||||
[here](https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/caddy_v2).</br>
|
||||
|
||||
`Caddyfile`
|
||||
```
|
||||
ipam.{$MY_DOMAIN} {
|
||||
reverse_proxy phpipam-web:80
|
||||
}
|
||||
```
|
||||
|
||||
# First run
|
||||
|
||||
![logo](https://i.imgur.com/W7YhwqK.jpg)
|
||||
|
||||
|
||||
* New phpipam installation
|
||||
* Automatic database installation
|
||||
* MySQL username: root
|
||||
* MySQL password: my_secret_mysql_root_pass
|
||||
|
||||
# Update
|
||||
|
||||
[Watchtower](https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/watchtower)
|
||||
updates the image automatically.
|
||||
|
||||
Manual image update:
|
||||
|
||||
- `docker-compose pull`<br>
|
||||
- `docker-compose up -d`<br>
|
||||
- `docker image prune`
|
||||
|
||||
# Backup and restore
|
||||
|
||||
#### Backup
|
||||
|
||||
Using [borg](https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/borg_backup)
|
||||
that makes daily snapshot of the entire directory.
|
||||
|
||||
#### Restore
|
||||
|
||||
* down the homer container `docker-compose down`<br>
|
||||
* delete the entire homer directory<br>
|
||||
* from the backup copy back the homer directory<br>
|
||||
* start the container `docker-compose up -d`
|
||||
|
|
Loading…
Reference in New Issue