A simple Traefik Setup.
- A linux server (e.g Debian or Ubunutu)
- Docker CE installed in the server
- User are able to run docker commands
- The Apache utils and program
htpasswd
for generates the basic auth
The docker compose files is required some environment variables for start the Traefik service.
DOCKBERT_DOMAIN
The domain for the dashboardDOCKBERT_CONTAINER_NAME
The container name. This is optional, defaultdockbert-traefik
.DOCKBERT_USERS_FILE
The file with the user authorization (see section Basic Auth User)DOCKBERT_ACME_EMAIL
The email address for Let's EncryptDOCKBERT_ACME_PATH
The directory where saving the Let's Encrypt the data
The environment variables are setting in different kind:
- Add a file
dockbert.env
in the user home directory- Set the environment variables in the bash or other initial RC files
- Create network dockbert-net.
docker network create dockbert-net
- Define the Environment variables
- Add bash script
dockbert
to the PATH for simplify start and stop the dockbert traefik
The bash script dockbert
is help to start and / or stop the dockbert traefik
Show the help / usage
$ dockbert help
Start the service
$ dockbert start
Stop the service
$ dockbert stop
The dashboard is secured with BasicAuth. See Traefik BasicAuth. To do this, create a file on the Docker host with apache
htpasswd
.The environment
DOCKBERT_USERS_FILE
is linked with this file
Example
The user file ${HOME}/etc/users.passwd
.
$ htpasswd -cb ${HOME}/etc/users.passwd sarah password
The configuration of the certificate directory is defined via the environment
DOCKBERT_ACME_PATH
. An email address is also required for this purpose via environmentDOCKBERT_ACME_EMAIL
.
Example
The directory ${HOME}/etc/traefik/acme
contains the acme.json file
$ mkdir -p ${HOME}/etc/traefik/acme
- Docker & Docker Compose: https://www.docker.com/
- Traefik: https://doc.traefik.io/traefik/
- Logo: Duck icons created by Pixel perfect - Flaticon
Copyright 2022 - 2024 Blueskyfish
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.