This commit is contained in:
DoTheEvolution 2021-02-22 23:25:12 +01:00
parent 4bb39e17dc
commit 21f4f6389f
4 changed files with 164 additions and 6 deletions

View File

@ -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

View File

@ -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.<br>
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 {

159
phpipam/readme.md Normal file
View File

@ -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).<br>
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.<br>
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.<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`

View File

@ -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