This is an old revision of the document!


Back  
 Next

Docker Containers

I seem to have gotten the Traefik reverse proxy working according to Techno Tim Put Wildcard Certificates and SSL on EVERYTHING (github reference_files for traefik-portainer-ssl)

Below is a basic description of the process that aligns with my configuration files. I do this for 2 reasons, both allowing me independence.

  1. Sometimes the source information or link are; changed, lost or removed.
  2. These note reference my current specific installation.

These containers all talk via a docker bridge network named proxy, docker network create proxy

  1. cd /home/docker_store
  2. sudo mkdir traefik
  3. sudo chown baumkp:baumkp traefik
  4. cd traefik
  5. mkdir data
  6. cd data
  7. touch acme.json
  8. chmod 600 acme.json
  9. touch traefik.yml
  10. cd ..

My traefik.yml locatation: /home/docker_store/traefik/data/traefik.yml. The current TechnoTim one here.

create docker network

  1. docker network create proxy
  1. touch docker-compose.yml
  2. touch provider.env

My docker-compose.yml location: /home/docker_store/traefik/docker-compose.yml. The current TechnoTim one here.
Note my docker compose file has some changes from the TechnoTim one, in particular the use of the Godaddy DNS chanlenge API instead of the the Cloudflare one used by TechnoTim.

Generate and Install Godaddy DNS Challenge Data

Sadly Godaddy does not make it as transparent as it should be to access their DNS challenge API. Perhaps because they are focused on their commercial certificate product. It is accessed from their developer portal Godaddy Developer Portal, from here the API keys can be made. These keys then need to be copied into /home/docker_store/traefik/data/provider.env:

GODADDY_API_KEY=[Your API_KEY key from Godaddy API]
GODADDY_API_SECRET=[Your API_SECRET key from Godaddy API]


Generate and install Basic Authentication Password

  1. sudo apt update
  2. sudo apt install apache2-utils
  1. echo $(htpasswd -nb "<USER>" "<PASSWORD>") | sed -e s/\\$/\\$\\$/g

NOTE: Replace <USER> with your username and <PASSWORD> with your password to be hashed.

Paste the output in your docker-compose.yml in line (traefik.http.middlewares.traefik-auth.basicauth.users=<USER>:<HASHED-PASSWORD>)

  1. cd data
  2. touch config.yml
  1. docker-compose up -d
  1. cd /home/docker_store
  2. sudo mkdir portainer
  3. sudo chown baumkp:baumkp portainer
  4. cd portainer
  5. touch docker-compose.yml
  6. mkdir data

My docker-compose.yml location: /home/docker_store/portainer/docker-compose.yml. The current TechnoTim one here.

  1. docker-compose up -d
  1. cd /home/docker_store/traefik/data
  2. nvim config.yml

My config.yml location: /home/docker_store/traefik/data/config.yml. The current TechnoTim one here., also look at Portainer's instructions here: Deploying Portainer behind Traefik Proxy

  1. docker-compose up -d --force-recreate


Folder Structure:

./traefik
├── data
│   ├── acme.json
│   ├── config.yml
│   ├── provided.env.yml
│   └── traefik.yml
└── docker-compose.yml

Todo: look at whitelisting in more detail

The main dokuwiki page dokuwiki_setup.

This use the the linuxserver.io image from dockerhub, linuxserver/dokuwiki. The Linuxserver.io documents can be found heredoc.linuxserver.io.
Defines web_data volume:

#Not USED
docker volume create --driver local \
    --opt type=none \
    --opt device="/home/docker_store/cloud.kptree.net/data" \
    --opt o=bind cloud_data
version: "2.1"
services:
  dokuwiki:
    image: lscr.io/linuxserver/dokuwiki:latest
    container_name: dokuwiki
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Australia/Perth
    volumes:
    - /home/docker_store/wiki.kptree.net/config:/config
    ports:
      - 8081:80
    #  - 443:443 #optional
    restart: unless-stopped 

Todo:

  • Need to create a local LAN only functional back-up of the wiki in my back-up server so I have a backup in case the main wiki with my configuration notes becomes unavailable.

Some of the following nuances may help when transferring Dokuwiki servers:

  • The dokuwiki image uses the following permanent volume storage, in config/dokuwiki:
    • conf (basically copy everything from existing to here)
    • data (basically copy everything from existing to here)
    • inc → /app/www/public/inc (symlink back to container, no point changing)
    • lib (basically copy everything from existing to here)
    • vendor → /app/www/public/vendor (symlink back to container, no point changing)

The DokuWiki page How to backup DokuWiki? has the basic information to backup a Dokuwiki.

After setting up the internal indexes could be messed up. The plugin SearchIndex Manager can be used to recreate these indexes.

Nextcloud publishes their own Docker container of Nextcloud. Linuxserver.io, as well as some others also have Nextcloud containers on Docker Hub.

Nextcloud needs a number of services to run; the main Nextcloud server, a database and Redis. In addition, there needs to be a proxy server or similar to forward on common domain requests to sub-domains as well as handling certificates, however this is required for all the various services and can be considered separately.

Refer to Nextcloud's Maintenace section on instructions to backup, restore and migrate Nextcloud. Also as I am using the official Nextcloud container it has additional instructions to https://github.com/docker-library/docs/blob/master/nextcloud/README.md#migrating-an-existing-installation:migrate Nextcloud to Docker.

  • uid: www-data / 33, gid: www-data / 33. This seems to be Debian standard. Alpine linux seems to use 82 for www-data. Just stick with uid/gid as 33 and ignore the names.

This Docker container is based linuxserver/calibre, Docker hub linuxserver/calibre, Calibre ebook management

The image is based upon current Ubuntu Long term release.

Calibre docker-compose.yml

This Docker container is based linuxserver/calibre-web., Docker hub linuxserver/calibre-web, Calibre-web wiki

The image is based upon current Ubuntu long term release.

Calibre-web docker-compose.yml

A torrent application with a web based server. I will probably need to fully build this one myself as I use a VPN with fire wall that only allows communication on LAN or using firewall tunnel for WAN.

  • Diun is a tool to notify if docker images have been updated. (Reportedly better than automatic updates such as watchtower.)
  • heindall a dashboard application. Low priority…..
  • /app/www/public/data/attic/docker_notes/docker-dokuwiki.1684929399.txt.gz
  • Last modified: 2023-05-24 Wed wk21 19:56
  • by baumkp