You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

162 lines
4.0 KiB
Markdown

4 years ago
# Homer in docker
4 years ago
###### guide-by-example
4 years ago
4 years ago
![logo](https://i.imgur.com/NSZ1DTH.png)
# Purpose
4 years ago
Homepage.
* [Github](https://github.com/bastienwirtz/homer)
4 years ago
* [DockerHub image used](https://hub.docker.com/r/b4bz/homer)
4 years ago
Homer is a simple static web page, configured using a yaml file.</br>
The docker image uses darkhttpd simple web server on alpine linux.
4 years ago
# Files and directory structure
```
4 years ago
/home/
└── ~/
└── docker/
└── homer/
├── assets/
4 years ago
│ └── tools/
4 years ago
├── .env
├── docker-compose.yml
└── config.yml
4 years ago
```
4 years ago
* `assets/` - a directory containing icons and other directories with icons
4 years ago
* `.env` - a file containing environment variables for docker compose
4 years ago
* `docker-compose.yml` - a docker compose file, telling docker how to run the container
4 years ago
* `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.
4 years ago
# docker-compose
`docker-compose.yml`
4 years ago
```yml
4 years ago
version: "2"
services:
homer:
image: b4bz/homer:latest
container_name: homer
hostname: homer
restart: unless-stopped
volumes:
4 years ago
- ./config.yml:/www/config.yml:ro
- ./assets/:/www/assets:ro
4 years ago
networks:
default:
external:
4 years ago
name: $DOCKER_MY_NETWORK
4 years ago
```
`.env`
4 years ago
```bash
4 years ago
# GENERAL
4 years ago
MY_DOMAIN=example.com
4 years ago
DOCKER_MY_NETWORK=caddy_net
4 years ago
TZ=Europe/Bratislava
4 years ago
```
# Reverse proxy
4 years ago
Caddy v2 is used, details
[here](https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/caddy_v2).</br>
4 years ago
`Caddyfile`
```
{$MY_DOMAIN} {
reverse_proxy homer:8080
}
```
# Config
4 years ago
Homer in this `config.yml` file.</br>
This one is based on the example from
the [github](https://github.com/bastienwirtz/homer).
4 years ago
`config.yml`
```yml
title: "Homepage"
subtitle: "Homer"
4 years ago
logo: "assets/logo.png"
4 years ago
# icon: "fas fa-skull-crossbones"
4 years ago
footer: '<p>less boring look with a footer</p>'
4 years ago
# Optional navbar
links:
4 years ago
- name: "Font Awesome Icons Galery"
4 years ago
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/"
4 years ago
# First level array represent a group
4 years ago
# Single service with an empty name if not using groups
services:
4 years ago
- name: "Main"
4 years ago
icon: "fab fa-docker"
items:
- name: "Bookstack"
logo: "/assets/tools/bookstack.png"
subtitle: "Notes and Documentation"
4 years ago
url: "https://book.example.com"
4 years ago
- name: "Bitwarden"
logo: "/assets/tools/bitwarden.png"
subtitle: "Password Manager"
4 years ago
url: "https://passwd.example.com"
4 years ago
- name: "Nextcloud"
logo: "/assets/tools/nextcloud.png"
subtitle: "File Sync & Share"
4 years ago
url: "https://nextcloud.example.com"
4 years ago
- name: "Monitoring"
icon: "fas fa-heartbeat"
items:
- name: "Prometheus + Grafana"
logo: "/assets/tools/grafana.png"
subtitle: "Metric analytics & dashboards"
4 years ago
url: "https://grafana.example.com"
4 years ago
- name: "Portainer"
logo: "/assets/tools/portainer.png"
subtitle: "Docker Manager"
4 years ago
url: "https://portainer.example.com"
4 years ago
```
4 years ago
![look](https://i.imgur.com/hrggtcZ.png)
4 years ago
# Update
4 years ago
[Watchtower](https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/watchtower)
updates the image automatically.
Manual image update:
4 years ago
4 years ago
- `docker-compose pull`</br>
- `docker-compose up -d`</br>
- `docker image prune`
4 years ago
4 years ago
# Backup and restore
4 years ago
4 years ago
#### Backup
Using [borg](https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/borg_backup)
that makes daily snapshot of the entire directory.
#### Restore
4 years ago
* 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`