Dockhand, initial setup
After setup, Dockhand can be accessed via the port 3000.
To start, we need to create a new environment at (settings > environments > Add environment).
Then, we can use the Docker management on the left. The primary sections are:
- Containers: for the current running containers.
- (Compose) Stacks: to easily create new containers via a predefined compose file.
- Volumes: Data inside containers.
0. Create a Share Network
Go into Networks and Create a network named "shared-network" with the default value for internal Docker communication.
1. Run a Docker application
Go into Stacks and add the following bentopdf compose file:
# https://hub.docker.com/r/bentopdf/bentopdf
services:
bentopdf-simple:
image: bentopdf/bentopdf-simple:latest
container_name: bentopdf
restart: unless-stopped
ports:
- "8080:8080"
networks:
- shared-network
networks:
shared-network:
external: true
Once running, you can access it by going into the application port: HTTP://<ip>:8080
With this setup, we can run any LAN Docker application via HTTP.
The following setup steps are to add HTTPS protection.
2. Add a LAN DNS
The first step is to create a local DNS. This will be used to more easily access the web Docker by putting the name of the service. A popular tool is Pi-hole: https://pi-hole.net/
Example of compose file:
# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
ports:
# DNS Ports
- "53:53/tcp"
- "53:53/udp"
# Default HTTP Port
#- "80:80/tcp"
# Default HTTPs Port. FTL will generate a self-signed certificate
- "8010:443/tcp"
# Uncomment the line below if you are using Pi-hole as your DHCP server
#- "67:67/udp"
# Uncomment the line below if you are using Pi-hole as your NTP server
#- "123:123/udp"
environment:
# Set the appropriate timezone for your location (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
TZ: 'Europe/Paris'
# If using Docker's default `bridge` network setting the dns listening mode should be set to 'ALL'
FTLCONF_dns_listeningMode: 'all'
volumes: # Volumes store your data between container upgrades
- 'pihole_config:/etc/pihole' # For persisting Pi-hole's databases and common configuration file
- 'pihole_dnsmasq:/etc/dnsmasq.d' # Uncomment the below if you have custom dnsmasq config files that you want to persist.
cap_add:
# See https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
# Optional, if Pi-hole should get some more processing time
- SYS_NICE
restart: unless-stopped
volumes:
pihole_config:
pihole_dnsmasq:
Create the file in a compose file in Stacks, then connect into it with https://<ip>:8010
After creating an account, you can add a custom domain name in: settings > local DNS Records
Then, we can create three domains with any name and the IP of the server:
domain1: **homarr.home**
domain2: **nginx.home**
domain3: **bentopdf.home**
Now, we configure the local computer DNS to use this LAN DNS as the primary one, and we can then access the bentopdf website by putting bentopdf.home in a web browser.
3. Nginx configuration (HTTP -> HTTPS)
Example of compose file:
# https://hub.docker.com/r/jc21/nginx-proxy-manager
services:
app:
image: 'docker.io/jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80'
- '81:81'
- '443:443'
volumes:
- 'nginx_proxy_manager_data:/data'
- 'nginx_proxy_manager_letencrypt:/etc/letsencrypt'
networks:
- shared-network
volumes:
nginx_proxy_manager_data:
nginx_proxy_manager_letencrypt:
networks:
shared-network:
external: true
We log in to the web interface and create an account via http://<ip>:81
Then we do the following:
- On your host computer, install OpenSSL if it is not installed. Linux command:
sudo apt install openssl
- We generate a self-sign certificate:
openssl req -x509 -nodes -days 365 \
-newkey rsa:2048 \
-keyout ./nginx-selfsigned.key \
-out ./nginx-selfsigned.crt \
-subj "/"
- We upload them in nginx in: certificates > Add Certificate > Custom certificates
We then go into Hosts > Proxy Hosts > Add Proxy Host. An example of configuration for bentopdf:
- Details:
domain names: bentopdf
scheme: http
forward hostname / IP: bentopdf-simple
forward port: 8080
- SSL:
SSL Certificate: <your added self sign certificate>
Force SSL + HTTP/2 Support, ON
The only change needed for other services is the hostname docker service name, and the forward port.
Now you should be able to connect into bentopdf using the URL https://bento.home
4. Dashboard access with homarr
Example of compose file:
#---------------------------------------------------------------------#
# Homarr - A simple, yet powerful dashboard for your server. #
#---------------------------------------------------------------------#
services:
homarr:
container_name: homarr
image: ghcr.io/homarr-labs/homarr:latest
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock # Optional, only if you want docker integration
- homarr_appdata:/appdata
environment:
- SECRET_ENCRYPTION_KEY=randomcharacter
expose:
- 7575
volumes:
homarr_appdata:
Create an account, then go into the top right logo > your preferences > Boards > new board.
Once into a board, click on the pencil top right > plus > new item > App (add to board).
Click on the top right of the new app to access the settings, edit items, and create apps on the fly.
The URL will be the DNS name put in Pi-hole and nginx for HTTPS access, and the "use different URL for ping" will be the local network of the app.
bentopdf.home would be the HTTPS DNS access.
And the ping would be done with http://bentopdf-simple:8080
You now have a dashboard to easily access the Docker app in HTTPS without the need to remember the network IP.
Source
-
homarr logo: https://icon-sets.iconify.design/cbi/homarr/
-
pi-hole logo: https://icon-sets.iconify.design/mdi/pi-hole/
-
nginx-proxy-manager logo: https://icon-sets.iconify.design/cbi/nginx-proxy-manager/