selfhosted-apps-docker/homer/readme.md

162 lines
4.0 KiB
Markdown
Raw Normal View History

2020-04-09 22:52:11 +00:00
# Homer in docker
2020-05-18 22:49:18 +00:00
###### guide-by-example
2020-04-09 22:52:11 +00:00
2020-04-25 22:10:50 +00:00
![logo](https://i.imgur.com/NSZ1DTH.png)
# Purpose
2020-04-09 22:52:11 +00:00
Homepage.
* [Github](https://github.com/bastienwirtz/homer)
2020-04-25 22:10:50 +00:00
* [DockerHub image used](https://hub.docker.com/r/b4bz/homer)
2020-05-10 12:52:29 +00:00
Homer is a simple static web page, configured using a yaml file.</br>
The docker image uses darkhttpd simple web server on alpine linux.
2020-04-25 22:10:50 +00:00
# Files and directory structure
```
2020-05-01 09:38:43 +00:00
/home/
└── ~/
└── docker/
└── homer/
├── assets/
2020-05-10 13:03:54 +00:00
│ └── tools/
2020-05-01 09:38:43 +00:00
├── .env
├── docker-compose.yml
└── config.yml
2020-04-25 22:10:50 +00:00
```
2020-05-10 13:03:54 +00:00
* `assets/` - a directory containing icons and other directories with icons
* `.env` - a file containing environmental variables for docker compose
* `docker-compose.yml` - a docker compose file, telling docker how to build the container
* `config.yml` - homer's configuration file bind mounted in to the container
All files and folders need to be provided.</br>
`assets` direcotry is part of this repo.
2020-04-25 22:10:50 +00:00
# docker-compose
`docker-compose.yml`
2020-04-25 22:15:47 +00:00
```yml
2020-04-25 22:10:50 +00:00
version: "2"
services:
homer:
image: b4bz/homer:latest
container_name: homer
hostname: homer
restart: unless-stopped
volumes:
2020-05-10 13:03:54 +00:00
- ./config.yml:/www/config.yml:ro
- ./assets/:/www/assets:ro
2020-04-25 22:10:50 +00:00
networks:
default:
external:
2020-05-20 18:29:12 +00:00
name: $DOCKER_MY_NETWORK
2020-04-25 22:10:50 +00:00
```
`.env`
2020-04-25 22:15:47 +00:00
```bash
2020-04-25 22:10:50 +00:00
# GENERAL
2020-05-16 13:18:21 +00:00
MY_DOMAIN=example.com
2020-05-20 18:29:12 +00:00
DOCKER_MY_NETWORK=caddy_net
2020-05-02 20:48:23 +00:00
TZ=Europe/Bratislava
2020-04-25 22:10:50 +00:00
```
# Reverse proxy
2020-05-01 09:51:20 +00:00
Caddy v2 is used, details
[here](https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/caddy_v2).</br>
2020-04-25 22:10:50 +00:00
`Caddyfile`
```
{$MY_DOMAIN} {
reverse_proxy homer:8080
}
```
# Config
2020-05-10 13:03:54 +00:00
Homer in this `config.yml` file.</br>
This one is based on the example from
the [github](https://github.com/bastienwirtz/homer).
2020-04-25 22:10:50 +00:00
`config.yml`
```yml
title: "Homepage"
subtitle: "Homer"
2020-05-05 15:39:05 +00:00
logo: "assets/logo.png"
2020-04-25 22:10:50 +00:00
# icon: "fas fa-skull-crossbones"
2020-04-25 22:39:26 +00:00
footer: '<p>less boring look with a footer</p>'
2020-04-25 22:10:50 +00:00
# Optional navbar
links:
2020-04-25 22:39:26 +00:00
- name: "Font Awesome Icons Galery"
2020-04-25 22:10:50 +00:00
icon: "fab fa-fort-awesome"
url: "https://fontawesome.com/icons?d=gallery"
- name: "Reddit SelfHosted"
icon: "fab fa-reddit"
url: "https://www.reddit.com/r/selfhosted/"
2020-04-25 22:39:26 +00:00
# First level array represent a group
2020-04-25 22:10:50 +00:00
# Single service with an empty name if not using groups
services:
2020-04-25 22:39:26 +00:00
- name: "Main"
2020-04-25 22:10:50 +00:00
icon: "fab fa-docker"
items:
- name: "Bookstack"
logo: "/assets/tools/bookstack.png"
subtitle: "Notes and Documentation"
2020-05-16 13:18:21 +00:00
url: "https://book.example.com"
2020-04-25 22:10:50 +00:00
- name: "Bitwarden"
logo: "/assets/tools/bitwarden.png"
subtitle: "Password Manager"
2020-05-16 13:18:21 +00:00
url: "https://passwd.example.com"
2020-04-25 22:10:50 +00:00
- name: "Nextcloud"
logo: "/assets/tools/nextcloud.png"
subtitle: "File Sync & Share"
2020-05-16 13:18:21 +00:00
url: "https://nextcloud.example.com"
2020-04-25 22:10:50 +00:00
- name: "Monitoring"
icon: "fas fa-heartbeat"
items:
- name: "Prometheus + Grafana"
logo: "/assets/tools/grafana.png"
subtitle: "Metric analytics & dashboards"
2020-05-16 13:18:21 +00:00
url: "https://grafana.example.com"
2020-04-25 22:10:50 +00:00
- name: "Portainer"
logo: "/assets/tools/portainer.png"
subtitle: "Docker Manager"
2020-05-16 13:18:21 +00:00
url: "https://portainer.example.com"
2020-04-25 22:10:50 +00:00
```
2020-04-25 22:39:26 +00:00
![look](https://i.imgur.com/hrggtcZ.png)
2020-04-25 22:10:50 +00:00
# Update
2020-05-10 12:52:29 +00:00
[Watchtower](https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/watchtower)
updates the image automatically.
Manual image update:
2020-04-25 22:10:50 +00:00
2020-05-10 12:52:29 +00:00
- `docker-compose pull`</br>
- `docker-compose up -d`</br>
- `docker image prune`
2020-04-09 22:52:11 +00:00
2020-04-25 22:10:50 +00:00
# Backup and restore
2020-04-09 22:52:11 +00:00
2020-05-10 12:52:29 +00:00
#### Backup
Using [borg](https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/borg_backup)
that makes daily snapshot of the entire directory.
#### Restore
2020-05-10 13:03:54 +00:00
* 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`