Skip to content

Commit ce50b49

Browse files
authoredJan 8, 2025
Outline with Keycloak and Let's Encrypt Using Docker Compose
1 parent 16f7050 commit ce50b49

7 files changed

+129
-446
lines changed
 

β€Ž.env

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Traefik Variables
2-
TRAEFIK_IMAGE_TAG=traefik:2.9
2+
TRAEFIK_IMAGE_TAG=traefik:3.2
3+
# Set the log level (DEBUG, INFO, WARN, ERROR)
34
TRAEFIK_LOG_LEVEL=WARN
4-
TRAEFIK_ACME_EMAIL=callvaldemar@gmail.com
5+
# The email address used by Let's Encrypt for renewal notices
6+
TRAEFIK_ACME_EMAIL=admin@example.com
7+
# The hostname used to access the Traefik dashboard and to configure domain-specific rules
58
TRAEFIK_HOSTNAME=traefik.outline.heyvaldemar.net
69
# Basic Authentication for Traefik Dashboard
710
# Username: traefikadmin

β€Ž.github/dependabot.yml

-34
This file was deleted.

β€Ž.github/workflows/00-deployment-verification.yml

-54
This file was deleted.

β€Ž01-traefik-outline-letsencrypt-docker-compose.yml

+33-140
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,3 @@
1-
# Outline with Keycloak and Let's Encrypt Using Docker Compose
2-
3-
# The complete installation guide is available on my website https://www.heyvaldemar.com/install-outline-and-keycloak-using-docker-compose/
4-
5-
# Change variables in the `.env` to meet your requirements.
6-
# Note that the `.env` file should be in the same directory as `01-traefik-outline-letsencrypt-docker-compose.yml`, `02-keycloak-outline-docker-compose.yml`, and `03-outline-minio-redis-docker-compose.yml`.
7-
8-
# The value for the `OUTLINE_OIDC_CLIENT_SECRET` variable can be obtained after installing Keycloak using `02-keycloak-outline-docker-compose.yml`.
9-
10-
# Additionally, you need to specify your values for `OUTLINE_SECRET_KEY` and `OUTLINE_UTILS_SECRET`.
11-
# The values for `OUTLINE_SECRET_KEY` and `OUTLINE_UTILS_SECRET` can be generated using the command:
12-
# `openssl rand -hex 32`
13-
14-
# Create networks for your services before deploying the configuration using the commands:
15-
# `docker network create traefik-network`
16-
# `docker network create keycloak-network`
17-
# `docker network create outline-network`
18-
19-
# Deploy Traefik using Docker Compose:
20-
# `docker compose -f 01-traefik-outline-letsencrypt-docker-compose.yml -p traefik up -d`
21-
22-
# Deploy Keycloak using Docker Compose:
23-
# `docker compose -f 02-keycloak-outline-docker-compose.yml -p keycloak up -d`
24-
25-
# Create a new `Realm` on Keycloak and name it `outline` (case sensitive).
26-
27-
# Create a `Client` in the new realm and configure it:
28-
# 1. Client type: `OpenID Connect`
29-
# 2. Client ID: `outline` (case sensitive)
30-
# 3. Client authentication: `on`
31-
# 4. Authentication flow: uncheck all other options and leave only `Standard flow`
32-
# 5. Set URLs:
33-
# - In the `Root URL` field, enter `https://outline.heyvaldemar.net/`
34-
# - In the `Home URL` field, enter `https://outline.heyvaldemar.net/`
35-
# - In the `Valid redirect URIs` field, enter `https://outline.heyvaldemar.net/*`
36-
37-
# Please note, outline.heyvaldemar.net is the domain name of my service.
38-
# Accordingly, you need to specify your domain name,
39-
# which points to the IP address of your server with the installed Traefik service,
40-
# which will redirect the request to Outline.
41-
42-
# Get a `Client secret` value on the `Credentials` tab of the `Client` that you created.
43-
# Specify the `OUTLINE_OIDC_CLIENT_SECRET` variable in the `.env`.
44-
45-
# Create a user on Keycloak for Outline.
46-
# Note that you have to specify an email address and a username.
47-
# Set a password for the new user.
48-
49-
# Deploy Keycloak using Docker Compose:
50-
# `docker compose -f 03-outline-minio-redis-docker-compose.yml -p outline up -d`
51-
52-
# Log in to Outline with the Username or Email specified on the Keycloak.
53-
54-
# Backups
55-
# The `backups-keycloak` container in the configuration is responsible for the following:
56-
# 1. **Database Backup**: Creates compressed backups of the PostgreSQL database using pg_dump.
57-
# Customizable backup path, filename pattern, and schedule through variables like `KEYCLOAK_POSTGRES_BACKUPS_PATH`, `KEYCLOAK_POSTGRES_BACKUP_NAME`, and `KEYCLOAK_BACKUP_INTERVAL`.
58-
# 2. **Backup Pruning**: Periodically removes backups exceeding a specified age to manage storage. Customizable pruning schedule and age threshold with `KEYCLOAK_POSTGRES_BACKUP_PRUNE_DAYS`.
59-
60-
# The `backups-outline` container in the configuration is responsible for the following:
61-
# 1. **Application Data Backup**: Compresses and stores backups of the application data on the same schedule. Controlled via variables such as `OUTLINE_DATA_BACKUPS_PATH`, `OUTLINE_DATA_BACKUP_NAME`, and `OUTLINE_BACKUP_INTERVAL`.
62-
# 2. **Backup Pruning**: Periodically removes backups exceeding a specified age to manage storage. Customizable pruning schedule and age threshold with `OUTLINE_DATA_BACKUP_PRUNE_DAYS`.
63-
# By utilizing these containers, consistent and automated backups of the essential components of your instance are ensured.
64-
# Moreover, efficient management of backup storage and tailored backup routines can be achieved through easy and flexible configuration using environment variables.
65-
66-
# # keycloak-restore-database.sh Description
67-
# This script facilitates the restoration of a database backup:
68-
# 1. **Identify Containers**: It first identifies the service and backups containers by name, finding the appropriate container IDs.
69-
# 2. **List Backups**: Displays all available database backups located at the specified backup path.
70-
# 3. **Select Backup**: Prompts the user to copy and paste the desired backup name from the list to restore the database.
71-
# 4. **Stop Service**: Temporarily stops the service to ensure data consistency during restoration.
72-
# 5. **Restore Database**: Executes a sequence of commands to drop the current database, create a new one, and restore it from the selected compressed backup file.
73-
# 6. **Start Service**: Restarts the service after the restoration is completed.
74-
# To make the `keycloak-restore-database.sh` script executable, run the following command:
75-
# `chmod +x keycloak-restore-database.sh`
76-
# Usage of this script ensures a controlled and guided process to restore the database from an existing backup.
77-
78-
# # outline-restore-database.sh Description
79-
# This script facilitates the restoration of a database backup:
80-
# 1. **Identify Containers**: It first identifies the service and backups containers by name, finding the appropriate container IDs.
81-
# 2. **List Backups**: Displays all available database backups located at the specified backup path.
82-
# 3. **Select Backup**: Prompts the user to copy and paste the desired backup name from the list to restore the database.
83-
# 4. **Stop Service**: Temporarily stops the service to ensure data consistency during restoration.
84-
# 5. **Restore Database**: Executes a sequence of commands to drop the current database, create a new one, and restore it from the selected compressed backup file.
85-
# 6. **Start Service**: Restarts the service after the restoration is completed.
86-
# To make the `outline-restore-database.sh` script executable, run the following command:
87-
# `chmod +x outline-restore-database.sh`
88-
# Usage of this script ensures a controlled and guided process to restore the database from an existing backup.
89-
90-
# # outline-restore-application-data.sh Description
91-
# This script is designed to restore the application data:
92-
# 1. **Identify Containers**: Similarly to the database restore script, it identifies the service and backups containers by name.
93-
# 2. **List Application Data Backups**: Displays all available application data backups at the specified backup path.
94-
# 3. **Select Backup**: Asks the user to copy and paste the desired backup name for application data restoration.
95-
# 4. **Stop Service**: Stops the service to prevent any conflicts during the restore process.
96-
# 5. **Restore Application Data**: Removes the current application data and then extracts the selected backup to the appropriate application data path.
97-
# 6. **Start Service**: Restarts the service after the application data has been successfully restored.
98-
# To make the `outline-restore-application-data.sh` script executable, run the following command:
99-
# `chmod +x outline-restore-application-data.sh`
100-
# By utilizing this script, you can efficiently restore application data from an existing backup while ensuring proper coordination with the running service.
101-
102-
# Author
103-
# I’m Vladimir Mikhalev, the Docker Captain, but my friends can call me Valdemar.
104-
# https://www.docker.com/captains/vladimir-mikhalev/
105-
106-
# My website with detailed IT guides: https://www.heyvaldemar.com/
107-
# Follow me on YouTube: https://www.youtube.com/channel/UCf85kQ0u1sYTTTyKVpxrlyQ?sub_confirmation=1
108-
# Follow me on Twitter: https://twitter.com/heyValdemar
109-
# Follow me on Instagram: https://www.instagram.com/heyvaldemar/
110-
# Follow me on Threads: https://www.threads.net/@heyvaldemar
111-
# Follow me on Mastodon: https://mastodon.social/@heyvaldemar
112-
# Follow me on Bluesky: https://bsky.app/profile/heyvaldemar.bsky.social
113-
# Follow me on Facebook: https://www.facebook.com/heyValdemarFB/
114-
# Follow me on TikTok: https://www.tiktok.com/@heyvaldemar
115-
# Follow me on LinkedIn: https://www.linkedin.com/in/heyvaldemar/
116-
# Follow me on GitHub: https://github.com/heyvaldemar
117-
118-
# Communication
119-
# Chat with IT pros on Discord: https://discord.gg/AJQGCCBcqf
120-
# Reach me at ask@sre.gg
121-
122-
# Give Thanks
123-
# Support on GitHub: https://github.com/sponsors/heyValdemar
124-
# Support on Patreon: https://www.patreon.com/heyValdemar
125-
# Support on BuyMeaCoffee: https://www.buymeacoffee.com/heyValdemar
126-
# Support on Ko-fi: https://ko-fi.com/heyValdemar
127-
# Support on PayPal: https://www.paypal.com/paypalme/heyValdemarCOM
128-
1291
networks:
1302
traefik-network:
1313
external: true
@@ -137,27 +9,42 @@ services:
1379
traefik:
13810
image: ${TRAEFIK_IMAGE_TAG}
13911
command:
12+
# Set the log level (DEBUG, INFO, WARN, ERROR)
14013
- "--log.level=${TRAEFIK_LOG_LEVEL}"
141-
- "--accesslog=true"
14+
# Enable the built-in API and web-based dashboard on /dashboard
14215
- "--api.dashboard=true"
143-
- "--api.insecure=true"
16+
# Enable the /ping endpoint so we can health-check Traefik
14417
- "--ping=true"
18+
# Assign the /ping endpoint to a dedicated entry point on port 8082
14519
- "--ping.entrypoint=ping"
146-
- "--entryPoints.ping.address=:8082"
147-
- "--entryPoints.web.address=:80"
148-
- "--entryPoints.websecure.address=:443"
20+
- "--entrypoints.ping.address=:8082"
21+
# Define the primary HTTP entry point on port 80
22+
- "--entrypoints.web.address=:80"
23+
# Define the secure (HTTPS) entry point on port 443
24+
- "--entrypoints.websecure.address=:443"
25+
# Enable the Docker provider to detect containers and their labels
14926
- "--providers.docker=true"
27+
# Point Traefik to the Docker socket
15028
- "--providers.docker.endpoint=unix:///var/run/docker.sock"
151-
- "--providers.docker.exposedByDefault=false"
29+
# Prevent automatic exposure of all containers; only expose containers
30+
# with "traefik.enable=true"
31+
- "--providers.docker.exposedbydefault=false"
32+
# Use ACME (Let's Encrypt) to generate/renew certificates via TLS challenge
15233
- "--certificatesresolvers.letsencrypt.acme.tlschallenge=true"
34+
# The email address used by Let's Encrypt for renewal notices
15335
- "--certificatesresolvers.letsencrypt.acme.email=${TRAEFIK_ACME_EMAIL}"
36+
# The file where ACME certificates are stored inside the container
15437
- "--certificatesresolvers.letsencrypt.acme.storage=/etc/traefik/acme/acme.json"
38+
# Enable Prometheus metrics
15539
- "--metrics.prometheus=true"
40+
# Configure Prometheus histogram buckets
15641
- "--metrics.prometheus.buckets=0.1,0.3,1.2,5.0"
157-
- "--global.checkNewVersion=true"
158-
- "--global.sendAnonymousUsage=false"
42+
# Check for newer Traefik versions and optionally log that info
43+
- "--global.checknewversion=true"
44+
# Disable sending anonymous usage data to the Traefik maintainers
45+
- "--global.sendanonymoususage=false"
15946
volumes:
160-
- /var/run/docker.sock:/var/run/docker.sock
47+
- /var/run/docker.sock:/var/run/docker.sock:ro
16148
- traefik-certificates:/etc/traefik/acme
16249
networks:
16350
- traefik-network
@@ -171,16 +58,22 @@ services:
17158
retries: 3
17259
start_period: 5s
17360
labels:
61+
# Enable Traefik for this container.
17462
- "traefik.enable=true"
63+
# A router to expose the Traefik dashboard
17564
- "traefik.http.routers.dashboard.rule=Host(`${TRAEFIK_HOSTNAME}`)"
176-
- "traefik.http.routers.dashboard.service=api@internal"
17765
- "traefik.http.routers.dashboard.entrypoints=websecure"
178-
- "traefik.http.services.dashboard.loadbalancer.server.port=8080"
17966
- "traefik.http.routers.dashboard.tls=true"
18067
- "traefik.http.routers.dashboard.tls.certresolver=letsencrypt"
181-
- "traefik.http.services.dashboard.loadbalancer.passhostheader=true"
68+
- "traefik.http.routers.dashboard.service=api@internal"
69+
# asic Authentication for the Traefik dashboard
18270
- "traefik.http.routers.dashboard.middlewares=authtraefik"
18371
- "traefik.http.middlewares.authtraefik.basicauth.users=${TRAEFIK_BASIC_AUTH}"
72+
# Specify the internal server port to the dashboard service
73+
- "traefik.http.services.dashboard.loadbalancer.server.port=8080"
74+
# Pass the original Host header to the backend
75+
- "traefik.http.services.dashboard.loadbalancer.passhostheader=true"
76+
# HTTP -> HTTPS redirect for all hosts
18477
- "traefik.http.routers.http-catchall.rule=HostRegexp(`{host:.+}`)"
18578
- "traefik.http.routers.http-catchall.entrypoints=web"
18679
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https"

β€Ž02-keycloak-outline-docker-compose.yml

+11
Original file line numberDiff line numberDiff line change
@@ -190,16 +190,27 @@ services:
190190
retries: 3
191191
start_period: 90s
192192
labels:
193+
# Enable Traefik for this container
193194
- "traefik.enable=true"
195+
# Match incoming requests on a specific hostname
194196
- "traefik.http.routers.keycloak.rule=Host(`${KEYCLOAK_HOSTNAME}`)"
197+
# Assign the router to a named Traefik service
195198
- "traefik.http.routers.keycloak.service=keycloak"
199+
# Use the 'websecure' (HTTPS) entry point
196200
- "traefik.http.routers.keycloak.entrypoints=websecure"
201+
# Define the internal container port for routing
197202
- "traefik.http.services.keycloak.loadbalancer.server.port=8080"
203+
# Enable TLS on this router
198204
- "traefik.http.routers.keycloak.tls=true"
205+
# Use Let's Encrypt for certificate management
199206
- "traefik.http.routers.keycloak.tls.certresolver=letsencrypt"
207+
# Pass the original Host header to the container
200208
- "traefik.http.services.keycloak.loadbalancer.passhostheader=true"
209+
# Apply a compression middleware
201210
- "traefik.http.routers.keycloak.middlewares=compresstraefik"
211+
# Define settings for the compression middleware
202212
- "traefik.http.middlewares.compresstraefik.compress=true"
213+
# Specify which Docker network Traefik should use for routing
203214
- "traefik.docker.network=traefik-network"
204215
restart: unless-stopped
205216
depends_on:

β€Ž03-outline-minio-redis-docker-compose.yml

+30-128
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,3 @@
1-
# Outline with Keycloak and Let's Encrypt Using Docker Compose
2-
3-
# The complete installation guide is available on my website https://www.heyvaldemar.com/install-outline-and-keycloak-using-docker-compose/
4-
5-
# Change variables in the `.env` to meet your requirements.
6-
# Note that the `.env` file should be in the same directory as `01-traefik-outline-letsencrypt-docker-compose.yml`, `02-keycloak-outline-docker-compose.yml`, and `03-outline-minio-redis-docker-compose.yml`.
7-
8-
# The value for the `OUTLINE_OIDC_CLIENT_SECRET` variable can be obtained after installing Keycloak using `02-keycloak-outline-docker-compose.yml`.
9-
10-
# Additionally, you need to specify your values for `OUTLINE_SECRET_KEY` and `OUTLINE_UTILS_SECRET`.
11-
# The values for `OUTLINE_SECRET_KEY` and `OUTLINE_UTILS_SECRET` can be generated using the command:
12-
# `openssl rand -hex 32`
13-
14-
# Create networks for your services before deploying the configuration using the commands:
15-
# `docker network create traefik-network`
16-
# `docker network create keycloak-network`
17-
# `docker network create outline-network`
18-
19-
# Deploy Traefik using Docker Compose:
20-
# `docker compose -f 01-traefik-outline-letsencrypt-docker-compose.yml -p traefik up -d`
21-
22-
# Deploy Keycloak using Docker Compose:
23-
# `docker compose -f 02-keycloak-outline-docker-compose.yml -p keycloak up -d`
24-
25-
# Create a new `Realm` on Keycloak and name it `outline` (case sensitive).
26-
27-
# Create a `Client` in the new realm and configure it:
28-
# 1. Client type: `OpenID Connect`
29-
# 2. Client ID: `outline` (case sensitive)
30-
# 3. Client authentication: `on`
31-
# 4. Authentication flow: uncheck all other options and leave only `Standard flow`
32-
# 5. Set URLs:
33-
# - In the `Root URL` field, enter `https://outline.heyvaldemar.net/`
34-
# - In the `Home URL` field, enter `https://outline.heyvaldemar.net/`
35-
# - In the `Valid redirect URIs` field, enter `https://outline.heyvaldemar.net/*`
36-
37-
# Please note, outline.heyvaldemar.net is the domain name of my service.
38-
# Accordingly, you need to specify your domain name,
39-
# which points to the IP address of your server with the installed Traefik service,
40-
# which will redirect the request to Outline.
41-
42-
# Get a `Client secret` value on the `Credentials` tab of the `Client` that you created.
43-
# Specify the `OUTLINE_OIDC_CLIENT_SECRET` variable in the `.env`.
44-
45-
# Create a user on Keycloak for Outline.
46-
# Note that you have to specify an email address and a username.
47-
# Set a password for the new user.
48-
49-
# Deploy Keycloak using Docker Compose:
50-
# `docker compose -f 03-outline-minio-redis-docker-compose.yml -p outline up -d`
51-
52-
# Log in to Outline with the Username or Email specified on the Keycloak.
53-
54-
# Backups
55-
# The `backups-keycloak` container in the configuration is responsible for the following:
56-
# 1. **Database Backup**: Creates compressed backups of the PostgreSQL database using pg_dump.
57-
# Customizable backup path, filename pattern, and schedule through variables like `KEYCLOAK_POSTGRES_BACKUPS_PATH`, `KEYCLOAK_POSTGRES_BACKUP_NAME`, and `KEYCLOAK_BACKUP_INTERVAL`.
58-
# 2. **Backup Pruning**: Periodically removes backups exceeding a specified age to manage storage. Customizable pruning schedule and age threshold with `KEYCLOAK_POSTGRES_BACKUP_PRUNE_DAYS`.
59-
60-
# The `backups-outline` container in the configuration is responsible for the following:
61-
# 1. **Application Data Backup**: Compresses and stores backups of the application data on the same schedule. Controlled via variables such as `OUTLINE_DATA_BACKUPS_PATH`, `OUTLINE_DATA_BACKUP_NAME`, and `OUTLINE_BACKUP_INTERVAL`.
62-
# 2. **Backup Pruning**: Periodically removes backups exceeding a specified age to manage storage. Customizable pruning schedule and age threshold with `OUTLINE_DATA_BACKUP_PRUNE_DAYS`.
63-
# By utilizing these containers, consistent and automated backups of the essential components of your instance are ensured.
64-
# Moreover, efficient management of backup storage and tailored backup routines can be achieved through easy and flexible configuration using environment variables.
65-
66-
# # keycloak-restore-database.sh Description
67-
# This script facilitates the restoration of a database backup:
68-
# 1. **Identify Containers**: It first identifies the service and backups containers by name, finding the appropriate container IDs.
69-
# 2. **List Backups**: Displays all available database backups located at the specified backup path.
70-
# 3. **Select Backup**: Prompts the user to copy and paste the desired backup name from the list to restore the database.
71-
# 4. **Stop Service**: Temporarily stops the service to ensure data consistency during restoration.
72-
# 5. **Restore Database**: Executes a sequence of commands to drop the current database, create a new one, and restore it from the selected compressed backup file.
73-
# 6. **Start Service**: Restarts the service after the restoration is completed.
74-
# To make the `keycloak-restore-database.sh` script executable, run the following command:
75-
# `chmod +x keycloak-restore-database.sh`
76-
# Usage of this script ensures a controlled and guided process to restore the database from an existing backup.
77-
78-
# # outline-restore-database.sh Description
79-
# This script facilitates the restoration of a database backup:
80-
# 1. **Identify Containers**: It first identifies the service and backups containers by name, finding the appropriate container IDs.
81-
# 2. **List Backups**: Displays all available database backups located at the specified backup path.
82-
# 3. **Select Backup**: Prompts the user to copy and paste the desired backup name from the list to restore the database.
83-
# 4. **Stop Service**: Temporarily stops the service to ensure data consistency during restoration.
84-
# 5. **Restore Database**: Executes a sequence of commands to drop the current database, create a new one, and restore it from the selected compressed backup file.
85-
# 6. **Start Service**: Restarts the service after the restoration is completed.
86-
# To make the `outline-restore-database.sh` script executable, run the following command:
87-
# `chmod +x outline-restore-database.sh`
88-
# Usage of this script ensures a controlled and guided process to restore the database from an existing backup.
89-
90-
# # outline-restore-application-data.sh Description
91-
# This script is designed to restore the application data:
92-
# 1. **Identify Containers**: Similarly to the database restore script, it identifies the service and backups containers by name.
93-
# 2. **List Application Data Backups**: Displays all available application data backups at the specified backup path.
94-
# 3. **Select Backup**: Asks the user to copy and paste the desired backup name for application data restoration.
95-
# 4. **Stop Service**: Stops the service to prevent any conflicts during the restore process.
96-
# 5. **Restore Application Data**: Removes the current application data and then extracts the selected backup to the appropriate application data path.
97-
# 6. **Start Service**: Restarts the service after the application data has been successfully restored.
98-
# To make the `outline-restore-application-data.sh` script executable, run the following command:
99-
# `chmod +x outline-restore-application-data.sh`
100-
# By utilizing this script, you can efficiently restore application data from an existing backup while ensuring proper coordination with the running service.
101-
102-
# Author
103-
# I’m Vladimir Mikhalev, the Docker Captain, but my friends can call me Valdemar.
104-
# https://www.docker.com/captains/vladimir-mikhalev/
105-
106-
# My website with detailed IT guides: https://www.heyvaldemar.com/
107-
# Follow me on YouTube: https://www.youtube.com/channel/UCf85kQ0u1sYTTTyKVpxrlyQ?sub_confirmation=1
108-
# Follow me on Twitter: https://twitter.com/heyValdemar
109-
# Follow me on Instagram: https://www.instagram.com/heyvaldemar/
110-
# Follow me on Threads: https://www.threads.net/@heyvaldemar
111-
# Follow me on Mastodon: https://mastodon.social/@heyvaldemar
112-
# Follow me on Bluesky: https://bsky.app/profile/heyvaldemar.bsky.social
113-
# Follow me on Facebook: https://www.facebook.com/heyValdemarFB/
114-
# Follow me on TikTok: https://www.tiktok.com/@heyvaldemar
115-
# Follow me on LinkedIn: https://www.linkedin.com/in/heyvaldemar/
116-
# Follow me on GitHub: https://github.com/heyvaldemar
117-
118-
# Communication
119-
# Chat with IT pros on Discord: https://discord.gg/AJQGCCBcqf
120-
# Reach me at ask@sre.gg
121-
122-
# Give Thanks
123-
# Support on GitHub: https://github.com/sponsors/heyValdemar
124-
# Support on Patreon: https://www.patreon.com/heyValdemar
125-
# Support on BuyMeaCoffee: https://www.buymeacoffee.com/heyValdemar
126-
# Support on Ko-fi: https://ko-fi.com/heyValdemar
127-
# Support on PayPal: https://www.paypal.com/paypalme/heyValdemarCOM
128-
1291
networks:
1302
outline-network:
1313
external: true
@@ -258,24 +130,43 @@ services:
258130
retries: 3
259131
start_period: 60s
260132
labels:
133+
# Enable Traefik for this container
261134
- "traefik.enable=true"
135+
# Match incoming requests on a specific hostname
262136
- "traefik.http.routers.minio-api.rule=Host(`${OUTLINE_MINIO_HOSTNAME}`)"
137+
# Assign the router to a named Traefik service
263138
- "traefik.http.routers.minio-api.service=minio-api"
139+
# Use the 'websecure' (HTTPS) entry point
264140
- "traefik.http.routers.minio-api.entrypoints=websecure"
141+
# Define the internal container port for routing
265142
- "traefik.http.services.minio-api.loadbalancer.server.port=9000"
143+
# Enable TLS on this router
266144
- "traefik.http.routers.minio-api.tls=true"
145+
# Use Let's Encrypt for certificate management
267146
- "traefik.http.routers.minio-api.tls.certresolver=letsencrypt"
147+
# Pass the original Host header to the container
268148
- "traefik.http.services.minio-api.loadbalancer.passhostheader=true"
149+
# Apply a compression middleware
269150
- "traefik.http.routers.minio-api.middlewares=compresstraefik"
151+
# Match incoming requests on a specific hostname
270152
- "traefik.http.routers.minio-console.rule=Host(`${OUTLINE_MINIO_CONSOLE_HOSTNAME}`)"
153+
# Assign the router to a named Traefik service
271154
- "traefik.http.routers.minio-console.service=minio-console"
155+
# Use the 'websecure' (HTTPS) entry point
272156
- "traefik.http.routers.minio-console.entrypoints=websecure"
157+
# Define the internal container port for routing
273158
- "traefik.http.services.minio-console.loadbalancer.server.port=9001"
159+
# Enable TLS on this router
274160
- "traefik.http.routers.minio-console.tls=true"
161+
# Use Let's Encrypt for certificate management
275162
- "traefik.http.routers.minio-console.tls.certresolver=letsencrypt"
163+
# Pass the original Host header to the container
276164
- "traefik.http.services.minio-console.loadbalancer.passhostheader=true"
165+
# Apply a compression middleware
277166
- "traefik.http.routers.minio-console.middlewares=compresstraefik"
167+
# Define settings for the compression middleware
278168
- "traefik.http.middlewares.compresstraefik.compress=true"
169+
# Specify which Docker network Traefik should use for routing
279170
- "traefik.docker.network=traefik-network"
280171
restart: unless-stopped
281172

@@ -319,16 +210,27 @@ services:
319210
retries: 3
320211
start_period: 90s
321212
labels:
213+
# Enable Traefik for this container
322214
- "traefik.enable=true"
215+
# Match incoming requests on a specific hostname
323216
- "traefik.http.routers.outline.rule=Host(`${OUTLINE_HOSTNAME}`)"
217+
# Assign the router to a named Traefik service
324218
- "traefik.http.routers.outline.service=outline"
219+
# Use the 'websecure' (HTTPS) entry point
325220
- "traefik.http.routers.outline.entrypoints=websecure"
221+
# Define the internal container port for routing
326222
- "traefik.http.services.outline.loadbalancer.server.port=3000"
223+
# Enable TLS on this router
327224
- "traefik.http.routers.outline.tls=true"
225+
# Use Let's Encrypt for certificate management
328226
- "traefik.http.routers.outline.tls.certresolver=letsencrypt"
227+
# Pass the original Host header to the container
329228
- "traefik.http.services.outline.loadbalancer.passhostheader=true"
229+
# Apply a compression middleware
330230
- "traefik.http.routers.outline.middlewares=compresstraefik"
231+
# Define settings for the compression middleware
331232
- "traefik.http.middlewares.compresstraefik.compress=true"
233+
# Specify which Docker network Traefik should use for routing
332234
- "traefik.docker.network=traefik-network"
333235
restart: unless-stopped
334236
depends_on:

β€ŽREADME.md

+50-88
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# Outline with Keycloak and Let's Encrypt Using Docker Compose
22

3-
[![Deployment Verification](https://github.com/heyvaldemar/outline-keycloak-traefik-letsencrypt-docker-compose/actions/workflows/00-deployment-verification.yml/badge.svg)](https://github.com/heyvaldemar/outline-keycloak-traefik-letsencrypt-docker-compose/actions)
4-
5-
The badge displayed on my repository indicates the status of the deployment verification workflow as executed on the latest commit to the main branch.
6-
7-
**Passing**: This means the most recent commit has successfully passed all deployment checks, confirming that the Docker Compose setup functions correctly as designed.
8-
93
πŸ“™ The complete installation guide is available on my [website](https://www.heyvaldemar.com/install-outline-and-keycloak-using-docker-compose/).
104

115
❗ Change variables in the `.env` to meet your requirements.
@@ -68,114 +62,82 @@ Deploy Keycloak using Docker Compose:
6862

6963
Log in to Outline with the Username or Email specified on the Keycloak.
7064

71-
# Backups
72-
73-
The `backups-keycloak` container in the configuration is responsible for the following:
74-
75-
1. **Database Backup**: Creates compressed backups of the PostgreSQL database using pg_dump.
76-
Customizable backup path, filename pattern, and schedule through variables like `KEYCLOAK_POSTGRES_BACKUPS_PATH`, `KEYCLOAK_POSTGRES_BACKUP_NAME`, and `KEYCLOAK_BACKUP_INTERVAL`.
77-
78-
2. **Backup Pruning**: Periodically removes backups exceeding a specified age to manage storage. Customizable pruning schedule and age threshold with `KEYCLOAK_POSTGRES_BACKUP_PRUNE_DAYS`.
79-
80-
The `backups-outline` container in the configuration is responsible for the following:
81-
82-
1. **Application Data Backup**: Compresses and stores backups of the application data on the same schedule. Controlled via variables such as `OUTLINE_DATA_BACKUPS_PATH`, `OUTLINE_DATA_BACKUP_NAME`, and `OUTLINE_BACKUP_INTERVAL`.
83-
84-
2. **Backup Pruning**: Periodically removes backups exceeding a specified age to manage storage. Customizable pruning schedule and age threshold with `OUTLINE_DATA_BACKUP_PRUNE_DAYS`.
85-
86-
By utilizing these containers, consistent and automated backups of the essential components of your instance are ensured. Moreover, efficient management of backup storage and tailored backup routines can be achieved through easy and flexible configuration using environment variables.
87-
88-
# keycloak-restore-database.sh Description
89-
90-
This script facilitates the restoration of a database backup:
91-
92-
1. **Identify Containers**: It first identifies the service and backups containers by name, finding the appropriate container IDs.
93-
94-
2. **List Backups**: Displays all available database backups located at the specified backup path.
95-
96-
3. **Select Backup**: Prompts the user to copy and paste the desired backup name from the list to restore the database.
97-
98-
4. **Stop Service**: Temporarily stops the service to ensure data consistency during restoration.
99-
100-
5. **Restore Database**: Executes a sequence of commands to drop the current database, create a new one, and restore it from the selected compressed backup file.
101-
102-
6. **Start Service**: Restarts the service after the restoration is completed.
103-
104-
To make the `keycloak-restore-database.shh` script executable, run the following command:
105-
106-
`chmod +x keycloak-restore-database.sh`
107-
108-
Usage of this script ensures a controlled and guided process to restore the database from an existing backup.
65+
## Author
10966

110-
# outline-restore-database.sh Description
67+
hey everyone,
11168

112-
This script facilitates the restoration of a database backup:
69+
πŸ’Ύ I’ve been in the IT game for over 20 years, cutting my teeth with some big names like [IBM](https://www.linkedin.com/in/heyvaldemar/), [Thales](https://www.linkedin.com/in/heyvaldemar/), and [Amazon](https://www.linkedin.com/in/heyvaldemar/). These days, I wear the hat of a DevOps Consultant and Team Lead, but what really gets me going is Docker and container technology - I’m kind of obsessed!
11370

114-
1. **Identify Containers**: It first identifies the service and backups containers by name, finding the appropriate container IDs.
71+
πŸ’› I have my own IT [blog](https://www.heyvaldemar.com/), where I’ve built a [community](https://discord.gg/AJQGCCBcqf) of DevOps enthusiasts who share my love for all things Docker, containers, and IT technologies in general. And to make sure everyone can jump on this awesome DevOps train, I write super detailed guides (seriously, they’re foolproof!) that help even newbies deploy and manage complex IT solutions.
11572

116-
2. **List Backups**: Displays all available database backups located at the specified backup path.
73+
πŸš€ My dream is to empower every single person in the DevOps community to squeeze every last drop of potential out of Docker and container tech.
11774

118-
3. **Select Backup**: Prompts the user to copy and paste the desired backup name from the list to restore the database.
75+
🐳 As a [Docker Captain](https://www.docker.com/captains/vladimir-mikhalev/), I’m stoked to share my knowledge, experiences, and a good dose of passion for the tech. My aim is to encourage learning, innovation, and growth, and to inspire the next generation of IT whizz-kids to push Docker and container tech to its limits.
11976

120-
4. **Stop Service**: Temporarily stops the service to ensure data consistency during restoration.
77+
Let’s do this together!
12178

122-
5. **Restore Database**: Executes a sequence of commands to drop the current database, create a new one, and restore it from the selected compressed backup file.
79+
## My 2D Portfolio
12380

124-
6. **Start Service**: Restarts the service after the restoration is completed.
81+
πŸ•ΉοΈ Click into [sre.gg](https://www.sre.gg/) β€” my virtual space is a 2D pixel-art portfolio inviting you to interact with elements that encapsulate the milestones of my DevOps career.
12582

126-
To make the `outline-restore-database.shh` script executable, run the following command:
83+
## My Courses
12784

128-
`chmod +x outline-restore-database.sh`
85+
πŸŽ“ Dive into my [comprehensive IT courses](https://www.heyvaldemar.com/courses/) designed for enthusiasts and professionals alike. Whether you're looking to master Docker, conquer Kubernetes, or advance your DevOps skills, my courses provide a structured pathway to enhancing your technical prowess.
12986

130-
Usage of this script ensures a controlled and guided process to restore the database from an existing backup.
87+
πŸ”‘ [Each course](https://www.udemy.com/user/heyvaldemar/) is built from the ground up with real-world scenarios in mind, ensuring that you gain practical knowledge and hands-on experience. From beginners to seasoned professionals, there's something here for everyone to elevate their IT skills.
13188

132-
# outline-restore-application-data.sh Description
89+
## My Services
13390

134-
This script is designed to restore the application data:
91+
πŸ’Ό Take a look at my [service catalog](https://www.heyvaldemar.com/services/) and find out how we can make your technological life better. Whether it's increasing the efficiency of your IT infrastructure, advancing your career, or expanding your technological horizons β€” I'm here to help you achieve your goals. From DevOps transformations to building gaming computers β€” let's make your technology unparalleled!
13592

136-
1. **Identify Containers**: Similarly to the database restore script, it identifies the service and backups containers by name.
93+
## Patreon Exclusives
13794

138-
2. **List Application Data Backups**: Displays all available application data backups at the specified backup path.
95+
πŸ† Join my [Patreon](https://www.patreon.com/heyvaldemar) and dive deep into the world of Docker and DevOps with exclusive content tailored for IT enthusiasts and professionals. As your experienced guide, I offer a range of membership tiers designed to suit everyone from newbies to IT experts.
13996

140-
3. **Select Backup**: Asks the user to copy and paste the desired backup name for application data restoration.
97+
## My Recommendations
14198

142-
4. **Stop Service**: Stops the service to prevent any conflicts during the restore process.
99+
πŸ“• Check out my collection of [essential DevOps books](https://kit.co/heyvaldemar/essential-devops-books)\
100+
πŸ–₯️ Check out my [studio streaming and recording kit](https://kit.co/heyvaldemar/my-studio-streaming-and-recording-kit)\
101+
πŸ“‘ Check out my [streaming starter kit](https://kit.co/heyvaldemar/streaming-starter-kit)
143102

144-
5. **Restore Application Data**: Removes the current application data and then extracts the selected backup to the appropriate application data path.
103+
## Follow Me
145104

146-
6. **Start Service**: Restarts the service after the application data has been successfully restored.
105+
🎬 [YouTube](https://www.youtube.com/channel/UCf85kQ0u1sYTTTyKVpxrlyQ?sub_confirmation=1)\
106+
🐦 [X / Twitter](https://twitter.com/heyvaldemar)\
107+
🎨 [Instagram](https://www.instagram.com/heyvaldemar/)\
108+
🐘 [Mastodon](https://mastodon.social/@heyvaldemar)\
109+
🧡 [Threads](https://www.threads.net/@heyvaldemar)\
110+
🎸 [Facebook](https://www.facebook.com/heyvaldemarFB/)\
111+
🧊 [Bluesky](https://bsky.app/profile/heyvaldemar.bsky.social)\
112+
πŸŽ₯ [TikTok](https://www.tiktok.com/@heyvaldemar)\
113+
πŸ’» [LinkedIn](https://www.linkedin.com/in/heyvaldemar/)\
114+
πŸ“£ [daily.dev Squad](https://app.daily.dev/squads/devopscompass)\
115+
🧩 [LeetCode](https://leetcode.com/u/heyvaldemar/)\
116+
🐈 [GitHub](https://github.com/heyvaldemar)
147117

148-
To make the `outline-restore-application-data.sh` script executable, run the following command:
118+
## Community of IT Experts
149119

150-
`chmod +x outline-restore-application-data.sh`
120+
πŸ‘Ύ [Discord](https://discord.gg/AJQGCCBcqf)
151121

152-
By utilizing this script, you can efficiently restore application data from an existing backup while ensuring proper coordination with the running service.
122+
## Refill My Coffee Supplies
153123

154-
# Author
124+
πŸ’– [PayPal](https://www.paypal.com/paypalme/heyvaldemarCOM)\
125+
πŸ† [Patreon](https://www.patreon.com/heyvaldemar)\
126+
πŸ’Ž [GitHub](https://github.com/sponsors/heyvaldemar)\
127+
πŸ₯€ [BuyMeaCoffee](https://www.buymeacoffee.com/heyvaldemar)\
128+
πŸͺ [Ko-fi](https://ko-fi.com/heyvaldemar)
155129

156-
I’m Vladimir Mikhalev, the [Docker Captain](https://www.docker.com/captains/vladimir-mikhalev/), but my friends can call me Valdemar.
130+
🌟 **Bitcoin (BTC):** bc1q2fq0k2lvdythdrj4ep20metjwnjuf7wccpckxc\
131+
πŸ”Ή **Ethereum (ETH):** 0x76C936F9366Fad39769CA5285b0Af1d975adacB8\
132+
πŸͺ™ **Binance Coin (BNB):** bnb1xnn6gg63lr2dgufngfr0lkq39kz8qltjt2v2g6\
133+
πŸ’  **Litecoin (LTC):** LMGrhx8Jsx73h1pWY9FE8GB46nBytjvz8g
157134

158-
🌐 My [website](https://www.heyvaldemar.com/) with detailed IT guides\
159-
🎬 Follow me on [YouTube](https://www.youtube.com/channel/UCf85kQ0u1sYTTTyKVpxrlyQ?sub_confirmation=1)\
160-
🐦 Follow me on [Twitter](https://twitter.com/heyValdemar)\
161-
🎨 Follow me on [Instagram](https://www.instagram.com/heyvaldemar/)\
162-
🧡 Follow me on [Threads](https://www.threads.net/@heyvaldemar)\
163-
🐘 Follow me on [Mastodon](https://mastodon.social/@heyvaldemar)\
164-
🧊 Follow me on [Bluesky](https://bsky.app/profile/heyvaldemar.bsky.social)\
165-
🎸 Follow me on [Facebook](https://www.facebook.com/heyValdemarFB/)\
166-
πŸŽ₯ Follow me on [TikTok](https://www.tiktok.com/@heyvaldemar)\
167-
πŸ’» Follow me on [LinkedIn](https://www.linkedin.com/in/heyvaldemar/)\
168-
🐈 Follow me on [GitHub](https://github.com/heyvaldemar)
135+
<div align="center">
169136

170-
# Communication
137+
### Show some πŸ’œ by starring some of the [repositories](https://github.com/heyValdemar?tab=repositories)!
171138

172-
πŸ‘Ύ Chat with IT pros on [Discord](https://discord.gg/AJQGCCBcqf)\
173-
πŸ“§ Reach me at ask@sre.gg
139+
![octocat](https://user-images.githubusercontent.com/10498744/210113490-e2fad07f-4488-4da8-a656-b9abbdd8cb26.gif)
174140

175-
# Give Thanks
141+
</div>
176142

177-
πŸ’Ž Support on [GitHub](https://github.com/sponsors/heyValdemar)\
178-
πŸ† Support on [Patreon](https://www.patreon.com/heyValdemar)\
179-
πŸ₯€ Support on [BuyMeaCoffee](https://www.buymeacoffee.com/heyValdemar)\
180-
πŸͺ Support on [Ko-fi](https://ko-fi.com/heyValdemar)\
181-
πŸ’– Support on [PayPal](https://www.paypal.com/paypalme/heyValdemarCOM)
143+
![footer](https://user-images.githubusercontent.com/10498744/210157572-1fca0242-8af2-46a6-bfa3-666ffd40ebde.svg)

0 commit comments

Comments
 (0)
Please sign in to comment.