Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
docker_notes:docker-dokuwiki [2023-05-28 Sun wk21 14:22] – [Nextcloud Container] baumkpdocker_notes:docker-dokuwiki [2026-04-05 Sun wk14 08:01] (current) – [backup wiki data] baumkp
Line 1: Line 1:
-{{tag>linux docker traefik godaddy dokuwiki nextcloud container}} +{{tag>linux docker traefik dokuwiki container}}
-======Docker Containers======+
  
-=====Reverse Proxy Server===== +======Dokuwiki====== 
-I seem to have gotten the Traefik reverse proxy working according to Techno Tim [[https://docs.technotim.live/posts/traefik-portainer-ssl/|Put Wildcard Certificates and SSL on EVERYTHING]] ([[https://github.com/techno-tim/techno-tim.github.io/tree/master/reference_files/traefik-portainer-ssl|github reference_files for traefik-portainer-ssl]])  +=====Main Dokuwiki Page=====
- +
-Below is a basic description of the process that aligns with my configuration files. I do this for 2 reasons, both allowing me independence.  +
-  - Sometimes the source information or link are; changed, lost or removed.  +
-  - These note reference my current specific installation. +
- +
-=====Proxy network to connect them all===== +
-These containers all talk via a docker bridge network named proxy, ''docker network create proxy'' +
-====Traefik==== +
-<code bash [enable_line_numbers="true"]> +
-cd /home/docker_store +
-sudo mkdir traefik +
-sudo chown baumkp:baumkp traefik +
-cd traefik +
-mkdir data +
-cd data +
-touch acme.json +
-chmod 600 acme.json +
-touch traefik.yml +
-cd ..</code> +
-My traefik.yml locatation: ''/home/docker_store/traefik/data/traefik.yml''. The current TechnoTim one [[https://github.com/techno-tim/techno-tim.github.io/tree/master/reference_files/traefik-portainer-ssl/traefik|here]].\\ +
- +
-===create docker network=== +
-<code bash [enable_line_numbers="true"]>docker network create proxy</code> +
-<code bash [enable_line_numbers="true"]>touch docker-compose.yml +
-touch provider.env</code> +
-My docker-compose.yml location: ''/home/docker_store/traefik/docker-compose.yml''. The current TechnoTim one [[https://github.com/techno-tim/techno-tim.github.io/tree/master/reference_files/traefik-portainer-ssl/traefik|here.]]\\  +
-//<fc #ff0000><fs small>**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.</fs></fc>//\\ +
- \\ +
-===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 [[https://developer.godaddy.com/|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'': +
-<code [enable_line_numbers="true">GODADDY_API_KEY=[Your API_KEY key from Godaddy API] +
-GODADDY_API_SECRET=[Your API_SECRET key from Godaddy API]</code> +
- \\ +
-===Generate and install Basic Authentication Password=== +
-<code bash [enable_line_numbers="true"]>sudo apt update +
-sudo apt install apache2-utils</code> +
-<code bash [enable_line_numbers="true"]>echo $(htpasswd -nb "<USER>" "<PASSWORD>") | sed -e s/\\$/\\$\\$/g</code> +
-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>+
- \\ +
- \\ +
-<code bash [enable_line_numbers="true"]>cd data +
-touch config.yml</code> +
-<code bash [enable_line_numbers="true"]>docker-compose up -d</code> +
-====Portainer==== +
-<code bash [enable_line_numbers="true"]>cd /home/docker_store +
-sudo mkdir portainer +
-sudo chown baumkp:baumkp portainer +
-cd portainer +
-touch docker-compose.yml +
-mkdir data</code> +
-My docker-compose.yml location: ''/home/docker_store/portainer/docker-compose.yml''. The current TechnoTim one [[https://github.com/techno-tim/techno-tim.github.io/tree/master/reference_files/traefik-portainer-ssl/portainer|here.]]\\ +
-<code bash [enable_line_numbers="true"]>docker-compose up -d</code> +
- +
-====Traefik Routes Config==== +
-<code bash [enable_line_numbers="true"]>cd /home/docker_store/traefik/data +
-nvim config.yml</code> +
-My config.yml location: ''/home/docker_store/traefik/data/config.yml''. The current TechnoTim one [[https://github.com/techno-tim/techno-tim.github.io/tree/master/reference_files/traefik-portainer-ssl/traefik|here.]], also look at **Portainer's** instructions here: [[https://docs.portainer.io/advanced/reverse-proxy/traefik|Deploying Portainer behind Traefik Proxy]]\\ +
-<code bash [enable_line_numbers="true"]>docker-compose up -d --force-recreate</code>\\ +
-Folder Structure: +
-<code>./traefik +
-├── data +
-│   ├── acme.json +
-│   ├── config.yml +
-│   ├── provided.env.yml +
-│   └── traefik.yml +
-└── docker-compose.yml</code> +
-====whitelisting==== +
-Todo: look at whitelisting in more detail +
-  * ''/home/docker_store/traefik/data/config.yml'' has traefik middleware whitelisting defined looks defined as default for all containers in config.yml. Need to check following: +
-    * Can this be defined for each container setup in config.yml? Looks likely. +
-    * Can this be reliably setup for public access of certain containers? +
-    * Ensure **no** public access to portainer and traefik dashboards? +
-  * See reddit dicussion [[https://www.reddit.com/r/Traefik/comments/qi2435/traefik_v2_mixed_and_both_internal_and_external/Traefik v2 mixed (and both) internal and external?]], which indicates this is so, however it notes a possible issue with VPN access. +
-====References==== +
-  *Traefik +
-    * [[https://hub.docker.com/_/traefik|Traefix]] +
-    * [[https://doc.traefik.io/traefik/https/acme/|traefik proxy & Lets Encrypt]] +
-    * Smarthome Beginner [[https://www.smarthomebeginner.com/traefik-docker-compose-guide-2022/|Ultimate Traefik Docker Compose Guide [2022] with LetsEncrypt]] +
-    * Christian Lempa [[https://github.com/ChristianLempa/boilerplates/tree/main/docker-compose/traefik|boilerplates/docker-compose/traefik/]] +
-    * Techno Tim [[https://github.com/techno-tim/techno-tim.github.io/blob/master/reference_files/traefik-portainer-ssl/traefik/docker-compose.yml| +
-techno-tim.github.io/reference_files/traefik-portainer-ssl/traefik/docker-compose.yml]] / [[https://docs.technotim.live/posts/traefik-portainer-ssl/|Put Wildcard Certificates and SSL on EVERYTHING]] +
-    * [[https://github.com/traefik/traefik/issues/6686| (Traefik v2.2) Unable to obtain ACME certificate with DNS challenge using Go Daddy]] +
-    * [[https://stackoverflow.com/questions/61234489/cannot-get-wildcard-certificate-with-traefik-v2-and-godaddy|Cannot get wildcard certificate with traefik v2 and godaddy]] +
-    * [[https://forums.docker.com/t/traefik-acme-with-godaddy-as-provider/56743|Traefik - ACME with GoDaddy as provider]] +
- +
-  *Traefik whitelists +
- +
-  *Nginx Proxy Manager +
-    * Nginxproxymanager.com [[https://nginxproxymanager.com/advanced-config/#best-practice-use-a-docker-network|Best Practice: Use a Docker network]] +
- +
- +
-=====Dokuwiki===== +
-====Main Dokuwiki Page====+
 The main dokuwiki page [[tech_notes:home_server|dokuwiki_setup]]. The main dokuwiki page [[tech_notes:home_server|dokuwiki_setup]].
-====Dokuwiki Container==== +=====Dokuwiki Container===== 
-This use the the [[https://www.linuxserver.io/|linuxserver.io]] image from dockerhub, [[https://hub.docker.com/r/linuxserver/dokuwiki/#!|linuxserver/dokuwiki]].  The Linuxserver.io documents can be found here[[https://docs.linuxserver.io/|doc.linuxserver.io]].\\ +This uses the [[https://www.linuxserver.io/|linuxserver.io]] image from dockerhub, [[https://hub.docker.com/r/linuxserver/dokuwiki/#!|linuxserver/dokuwiki]].  The Linuxserver.io documents can be found here[[https://docs.linuxserver.io/|doc.linuxserver.io]].\\ 
-Defines web_data volume:+++++Defines web_data volume:|
 <code bash> <code bash>
 #Not USED #Not USED
Line 110: Line 14:
     --opt o=bind cloud_data     --opt o=bind cloud_data
 </code> </code>
- +++++ 
-<code yaml>version: "2.1"+++++docker.yaml| 
 +<code yaml>---
 services: services:
   dokuwiki:   dokuwiki:
     image: lscr.io/linuxserver/dokuwiki:latest     image: lscr.io/linuxserver/dokuwiki:latest
-    container_name: dokuwiki+    container_name: wiki
     environment:     environment:
-      - PUID=1000 +      - PUID=33 
-      - PGID=1000+      - PGID=33
       - TZ=Australia/Perth       - TZ=Australia/Perth
     volumes:     volumes:
Line 126: Line 31:
     #  - 443:443 #optional     #  - 443:443 #optional
     restart: unless-stopped </code>     restart: unless-stopped </code>
- +++++ 
-Todo: +====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. +  *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. 
-  +=====Backup===== 
 +====backup server==== 
 +This wiki is used to help setup and maintain my home servers / lab, so if the server becomes unavailable it can become difficult to maintain the lab servers.  Hence this wiki is installed on 2 servers, the main one with a public facing web page and a duplicated back-up on a local only facing web page.  I only intermittantly copy the contents to the backup server.  The following is the back up script. 
 +===backup wiki data===
 Some of the following nuances may help when transferring Dokuwiki servers: Some of the following nuances may help when transferring Dokuwiki servers:
-  * The dokuwiki image uses the following permanent volume storage, in config/dokuwiki: +  *The dokuwiki image uses the following permanent volume storage, in config/dokuwiki: 
-    * conf  (basically copy everything from existing to here) +    *conf  (basically copy everything from existing to here) 
-    * data  (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) +    *inc -> /app/www/public/inc (symlink back to container, no point changing) 
-    * lib  (basically copy everything from existing to here) +    *lib  (basically copy everything from existing to here) 
-    * vendor -> /app/www/public/vendor (symlink back to container, no point changing) +    *vendor -> /app/www/public/vendor (symlink back to container, no point changing)
-The DokuWiki page [[https://www.dokuwiki.org/faq:backup|How to backup DokuWiki?]] has the basic information to backup a Dokuwiki.+
  
-After setting up the internal indexes could be messed upThe plugin SearchIndex Manager can be used to recreate these indexes.+++++wiki_to_local.wiki_copy.sh| 
 +<code bash> 
 +#!/bin/bash 
 +# script to copy main wiki to local wiki
  
-=====Nextcloud Container===== +#cp flags: -r => recurse (into sub-directories), -pmaintain source metadata.
-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.+#s_d => source directory 
 +s_d="/mnt/docker_store/router_backup/wiki/config/dokuwiki/"
  
-Refer to Nextcloud's [[https://docs.nextcloud.com/server/latest/admin_manual/maintenance/index.html|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. +#d_d => destination directory 
-  * 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. +d_d="/mnt/docker_store/wiki/config/dokuwiki/"
-  * ''docker exec -u www-data nextcloud-app-1 php /var/www/html/cron.php'' runs the cron.php +
-  *  +
  
-====References==== +#sub_d => sub-directory, see list of sub directories above to be copied. 
-  *docs nextcloud +sub_d="conf" 
-    * [[https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/config_sample_php_parameters.html#default-parameters|Configuration Parameters]] +rm -r $d_d$sub_d 
-    *[[https://help.nextcloud.com/t/is-there-a-safe-and-reliable-way-to-move-data-directory-out-of-web-root/3642|is-there-a-safe-and-reliable-way-to-move-data-directory-out-of-web-root]] +cp -rp $s_d$sub_d $d_d$sub_d
-    *[[https://help.nextcloud.com/t/howto-change-move-data-directory-after-installation/17170|help.nextcloud.com/t/howto-change-move-data-directory-after-installation]] +
-    *[[https://github.com/nextcloud|github.com/nextcloud]] +
-=====Calibre=====+
  
-====Calibre==== +sub_d="data" 
-This Docker container is based [[https://fleet.linuxserver.io/image?name=linuxserver/calibre|linuxserver/calibre]], [[https://hub.docker.com/r/linuxserver/calibre|Docker hub linuxserver/calibre]], [[https://calibre-ebook.com/|Calibre ebook management]]+rm -$d_d$sub_d 
 +cp -rp $s_d$sub_d $d_d$sub_d
  
-The image is based upon current Ubuntu Long term release.+sub_d="lib" 
 +rm -r $d_d$sub_d 
 +cp -rp $s_d$sub_d $d_d$sub_d
  
-++++Calibre docker-compose.yml| 
-<code> 
-version: "3.9" 
-services: 
-  calibre: 
-    image: lscr.io/linuxserver/calibre:latest 
-    container_name: calibre 
-    security_opt: 
-      - seccomp:unconfined #optional 
-    environment: 
-      - PUID=1000 
-      - PGID=1000 
-      - TZ=Australia/Perth 
-      - PASSWORD= #optional 
-      - CLI_ARGS= #optional 
-    volumes: 
-      - /media/disk1/KarlData/Karl Data 2/Calibre_library:/config 
-    ports: 
-      - 8088:8080 
-      - 8089:8081 
-    restart: unless-stopped 
-    networks: 
-      - proxy 
- 
-networks: 
-  proxy: 
-    external: true 
 </code> </code>
 +To use: ''sudo bash wiki_to_local.wiki_copy.sh''
 +++++
  
-Notes: +The DokuWiki page [[https://www.dokuwiki.org/faq:backup|How to backup DokuWiki?]] has the basic information to backup Dokuwiki.
-  - Example version: "2.1" changes to "3.9" with no problem +
-  - The log error/warning concerning "Setting up desktop integration failed with error:...." is common error when using Calibre on a server where desktop is not set up <fc #008000>Can be safely ignored.</fc> +
-  - To allow shell access added to ''docker-compose.yml'': <code> +
-    tty: true +
-    stdin_open: true +
-    command: /bin/sh</code>+
  
-+++++After setting up the internal indexes could be messed up. The plugin SearchIndex Manager can be used to recreate these indexes.
  
-====Calibre-web====+====php/php-fpm settings==== 
 +php /php-fpm overrides are in the config/php directory.  The files in this directory can be used to set php.ini and www.conf override settings.  I followed the direction for php settings from dokuwiki.  I use my preferred settings for php-fpm.  (I appreciate that dokuwiki does not need a lot of resources, however I do not want performance to be resource limited.  Many of the setting are maximum allowances, an do not use resources unless needed.) 
 +++++conf/php/php-local.ini| 
 +<code php>; Edit this file to override php.ini directives and restart the container
  
-This Docker container is based [[https://fleet.linuxserver.io/image?name=linuxserver/calibre-web|linuxserver/calibre-web.]], [[https://hub.docker.com/r/linuxserver/calibre-web|Docker hub linuxserver/calibre-web]], [[https://github.com/janeczku/calibre-web/wiki|Calibre-web wiki]]+date.timezone = Australia/Perth 
 +upload_max_filesize 100M 
 +post_max_size = 100M
  
-The image is based upon current Ubuntu long term release.+;recommendation from https://www.dokuwiki.org/install:php PHP configuration for Douwiki 
 +memory_limit = 256M 
 +implicit_flush = off 
 +max_execution_time = 30 
 +max_input_time = 60 
 +max_input_vars = 10000 
 +variables_order = "EGPCS" 
 +register_argc_argv = off
  
-++++Calibre-web docker-compose.yml+</code> 
-<code> +++++ 
-version: "3.9" +++++conf/php/www2.conf
-services: +<code php>; Edit this file to override www.conf and php-fpm.conf directives and restart the container
-  calibre-web: +
-    image: lscr.io/linuxserver/calibre-web:latest +
-    #image: lscr.io/linuxserver/calibre-web:0.6.18-ls169 +
-    container_name: calibre-web +
-    security_opt: +
-      - seccomp:unconfined #optional +
-    environment: +
-      - PUID=1000 +
-      - PGID=1000 +
-      - TZ=Australia/Perth +
-      - DOCKER_MODS=linuxserver/mods:universal-calibre #optional +
-      - OAUTHLIB_RELAX_TOKEN_SCOPE=1 #optional +
-    volumes: +
-      - /home/docker_store/calibre-web/config:/config +
-      - /media/disk1/KarlData/Karl Data 2/Calibre_library:/books +
-    ports: +
-      - 8087:8083 +
-    restart: unless-stopped +
-    networks: +
-      - proxy+
  
-networks: +; Pool name 
-  proxy: +[www] 
-    external: true+pm.max_children = 50 
 +pm.max_spare_servers = 5
 </code> </code>
- 
-Notes: 
-  - Example version: "2.1" changes to "3.9" with no problem 
-  - The default login / password: admin / admin123 
-  - The /books direct points to the directory specified for the existing (or new) Calibre library 
-  - The log error/warning concerning "Setting up desktop integration failed with error:...." is a common error when using Calibre on a server where desktop is not set up.  <fc #008000>Can be safely ignored.</fc> 
 ++++ ++++
-====References==== 
-  *Matthias Schoettle [[https://mattsch.com/2020/01/16/notes-on-traefik-v2-nextcloud-etc/|Notes on traefik v2, Nextcloud, etc.]]  
-  *Nextcloud Docs: 
-    *[[https://docs.nextcloud.com/|Nextcloud Documentation Overview]] 
-    *The [[https://docs.nextcloud.com/server/latest/admin_manual/maintenance/index.html|Maintenance]] section covers migrating to another server as well as backup, restore and upgrading. 
-  *smarthome beginner's [[https://www.smarthomebeginner.com/traefik-docker-nextcloud/|Nextcloud Docker with Traefik Reverse Proxy for Beginners]] 
-  *Reddit[[https://www.reddit.com/r/docker/comments/njnvth/linuxserverio_nextcloud_dockercompoe_is_all_i_need/Linuxserver.io Nextcloud docker-compoe is all i need?]] 
-  *[[https://help.nextcloud.com/t/collabora-setup-with-docker-linuxserver-ios-letsencrypt/79563|Collabora setup with docker (linuxserver.io’s letsencrypt)]] 
-  *[[https://linuxhandbook.com/install-nextcloud-docker/|How to Install Nextcloud with Docker on Your Linux Server]] 
-  *[[https://www.youtube.com/watch?v=aIBTbsk7rnA|Youtube - How to Install Nextcloud on Docker using Portainer]] 
-  *linuxserver.io [[https://forum.libreelec.tv/thread/25327-install-nextcloud-linuxserver-io/|Install Nextcloud (LinuxServer.io)]] 
-  *Nextcloud [[https://github.com/nextcloud/docker/blob/master/.examples/docker-compose/insecure/mariadb/apache/docker-compose.yml| docker/.examples/docker-compose/insecure/mariadb/apache/docker-compose.yml]] 
-  *Christain Lempa [[https://github.com/ChristianLempa/boilerplates/blob/main/docker-compose/nextcloud/nextcloud.yaml| boilerplates/docker-compose/nextcloud/nextcloud.yaml]] 
- 
-=====Deluge===== 
-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. 
  
-=====Other Possible Apps/Images===== +I noticed a few days after implementing these changes the Wiki response had improved.  The page updates seemed much faster. 
-  *[[https://crazymax.dev/diun/|Diun]] is a tool to notify if docker images have been updated. (Reportedly better than automatic updates such as watchtower.) +====Dokuwiki links==== 
-  *heindall a dashboard application. Low priority..... +Dokuwiki defaults to opening all links in the same page.  I prefer external links the be opened in a new tab.  The option can be set under admin/configuration/Link Settings/extern. Set to ''_tab'' for external links to open in new tab.  See [[https://www.dokuwiki.org/config|Configuring DokuWiki]] and [[https://www.dokuwiki.org/config:target|Configuration Setting: target]].
-  *[[https://docs.linuxserver.io/general/awesome-lsio|linuxserver.io docker images]]+
  
-<- docker_notes:docker-compose|Back ^ docker_notes:index|Start page ^ docker_notes:docker-deluge|Next ->+<- docker_notes:security|Back ^ docker_notes:index|Start page ^ docker_notes:docker-nextcloud|Next ->