From 21f4f6389f063f4e9299673d41673ab4fca0b04a Mon Sep 17 00:00:00 2001 From: DoTheEvolution Date: Mon, 22 Feb 2021 23:25:12 +0100 Subject: [PATCH] update --- README.md | 2 +- caddy_v2/readme.md | 5 +- phpipam/readme.md | 159 ++++++++++++++++++++++++++++++++++++++++++++ portainer/readme.md | 4 +- 4 files changed, 164 insertions(+), 6 deletions(-) create mode 100644 phpipam/readme.md diff --git a/README.md b/README.md index 6a75a95..9ae0e3a 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ You do need to have **basic linux and basic docker-compose knowledge**, the shit here is pretty hand holding and detailed, but it still should not be your first time running a docker container. -a certain format is followed +a certain format is followed in the services pages * **Purpose & Overview** - basic overview and intented use * **Files and directory structure** - lists all the files/folder involved diff --git a/caddy_v2/readme.md b/caddy_v2/readme.md index c0dd5f4..e4bb968 100644 --- a/caddy_v2/readme.md +++ b/caddy_v2/readme.md @@ -25,7 +25,6 @@ all hosted on your local network. Caddy is a powerful, enterprise-ready, open source web server with automatic HTTPS written in Go.
- Web servers are build to deal with http traffic, so they are an obvious choice for the function of reverse proxy. @@ -34,8 +33,8 @@ In this setup Caddy is used mostly as Https encrypted tunel ends with it, so that the traffic can be analyzed and dealt with based on the settings in `Caddyfile`. -Caddy with its build-in https and and sane config approach -allows a simple config to just work. +Caddy with its build-in https and and simple config approach +allows even most trivial configs to just work: ``` whatever.example.com { diff --git a/phpipam/readme.md b/phpipam/readme.md new file mode 100644 index 0000000..67f5154 --- /dev/null +++ b/phpipam/readme.md @@ -0,0 +1,159 @@ +# phpIPAM in docker + +###### guide-by-example + +![logo](https://i.imgur.com/GrWPooR.png) + +# WORK IN PROGRESS +# WORK IN PROGRESS +# WORK IN PROGRESS + +# Purpose + +IP address managment, LAN information and documentation tool. + + +* [Github](https://github.com/phpipam/phpipam) +* [DockerHub image used](https://hub.docker.com/r/phpipam/phpipam-www) + +IPAM is a universal term that stands for +[IP Address Management](https://en.wikipedia.org/wiki/IP_address_management).
+ +My exposure to it is very limited and at this moment +I only use it to keep track of used IP. + +Can be used to keep inventory of IT hardware, or organization of server racks. + + +# Files and directory structure + +``` +/home/ +└── ~/ + └── docker/ + └── phpipam/ + ├── phpipam-mariadb-data/ + ├── .env + └── docker-compose.yml +``` + +* `phpipam-mariadb-data/` - a directory where phpipam will store its database data +* `.env` - a file containing environment variables for docker compose +* `docker-compose.yml` - a docker compose file, telling docker how to run the containers + +You only need to provide the files.
+The directory is created by docker compose on the first run. + +# docker-compose + +`docker-compose.yml` +```yml +version: '3' +services: + + phpipam-web: + image: phpipam/phpipam-www:latest + container_name: phpipam-web + hostname: phpipam-web + # ports: + # - "80:80" + restart: unless-stopped + env_file: .env + depends_on: + - phpipam-mariadb + + phpipam-mariadb: + image: mariadb:latest + container_name: phpipam-mariadb + hostname: phpipam-mariadb + restart: unless-stopped + env_file: .env + volumes: + - ./phpipam-mariadb-data:/var/lib/mysql + + networks: + default: + external: + name: $DOCKER_MY_NETWORK +``` + +`.env` +```bash +# GENERAL +DOCKER_MY_NETWORK=caddy_net +TZ=EuropeBratislava + +IPAM_DATABASE_HOST=phpipam-mariadb +IPAM_DATABASE_PASS=my_secret_phpipam_pass +IPAM_DATABASE_WEBHOST=% +MYSQL_ROOT_PASSWORD=my_secret_mysql_root_pass +``` + +# Scheduling and cron issues + +The default docker-compose deployment uses cron container.
+Problem is it does not work, so Ofelia is used.
+[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).
+ +`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`
+- `docker-compose up -d`
+- `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`
+* delete the entire homer directory
+* from the backup copy back the homer directory
+* start the container `docker-compose up -d` diff --git a/portainer/readme.md b/portainer/readme.md index c506d39..f01ceda 100644 --- a/portainer/readme.md +++ b/portainer/readme.md @@ -10,7 +10,7 @@ Web UI for overview and management of docker environment. * [Official site](https://www.portainer.io) * [Github](https://github.com/portainer/portainer) -* [DockerHub image used](https://hub.docker.com/r/portainer/portainer/) +* [DockerHub image used](https://hub.docker.com/r/portainer/portainer-ce/) Portainer is a lightweight management web UI, that allows to easily manage docker containers, networks, volumes, images,... the work. @@ -45,7 +45,7 @@ version: '2' services: portainer: - image: portainer/portainer + image: portainer/portainer-ce container_name: portainer hostname: portainer command: -H unix:///var/run/docker.sock