Skip to content

Commit 3bff1a2

Browse files
authored
Mattermost with Let's Encrypt Using Docker Compose
1 parent 211fbcc commit 3bff1a2

5 files changed

+188
-146
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.mattermost.heyvaldemar.net
69
# Basic Authentication for Traefik Dashboard
710
# Username: traefikadmin

β€Ž.github/dependabot.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "github-actions" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"

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

+47-27
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,59 @@ jobs:
1212
deploy-and-test:
1313
runs-on: ubuntu-latest
1414

15+
env:
16+
NETWORK_ONE: mattermost-network
17+
NETWORK_TWO: traefik-network
18+
DOCKER_COMPOSE_FILE: mattermost-traefik-letsencrypt-docker-compose.yml
19+
APP_HOSTNAME: mattermost.heyvaldemar.net
20+
APP_TRAEFIK_HOSTNAME: traefik.mattermost.heyvaldemar.net
21+
COMPOSE_PROJECT_NAME: mattermost
22+
1523
steps:
16-
- name: Checkout repository
17-
uses: actions/checkout@v4
24+
- name: Checkout repository
25+
uses: actions/checkout@v4
26+
27+
- name: Create necessary Docker networks
28+
run: |
29+
docker network create $NETWORK_ONE || true
30+
docker network create $NETWORK_TWO || true
1831
19-
- name: Set up Docker Buildx
20-
uses: docker/setup-buildx-action@v3
32+
- name: Start up services using Docker Compose
33+
run: docker compose -f $DOCKER_COMPOSE_FILE -p $COMPOSE_PROJECT_NAME up -d
2134

22-
- name: Create necessary Docker networks
23-
run: |
24-
docker network create mattermost-network || true
25-
docker network create traefik-network || true
35+
- name: Modify /etc/hosts for internal routing
36+
run: |
37+
echo "127.0.0.1 $APP_HOSTNAME" | sudo tee -a /etc/hosts
38+
echo "127.0.0.1 $APP_TRAEFIK_HOSTNAME" | sudo tee -a /etc/hosts
2639
27-
- name: Start up services using Docker Compose
28-
run: docker compose -f mattermost-traefik-letsencrypt-docker-compose.yml up -d
40+
- name: Print Docker Compose services status
41+
run: docker ps
2942

30-
- name: Modify /etc/hosts for internal routing
31-
run: |
32-
echo "127.0.0.1 mattermost.heyvaldemar.net" | sudo tee -a /etc/hosts
33-
echo "127.0.0.1 traefik.mattermost.heyvaldemar.net" | sudo tee -a /etc/hosts
43+
- name: Wait for the application to be ready via Traefik
44+
run: |
45+
echo "Checking the routing and availability of the application via Traefik..."
46+
timeout 5m bash -c 'while ! curl -fsSLk "https://$APP_HOSTNAME"; do \
47+
echo "Waiting for the application to be ready..."; \
48+
sleep 10; \
49+
done'
3450
35-
- name: Print Docker Compose services status
36-
run: docker ps
51+
- name: Wait for the Traefik dashboard to be ready
52+
run: |
53+
echo "Checking the routing and availability of the Traefik dashboard..."
54+
timeout 5m bash -c 'while ! curl -fsSLk --write-out "%{http_code}" --output /dev/null "https://$APP_TRAEFIK_HOSTNAME" | grep -E "200|401"; do \
55+
echo "Waiting for the application to be ready..."; \
56+
sleep 10; \
57+
done'
3758
38-
- name: Wait for the application to be ready via Traefik
39-
run: |
40-
echo "Checking the routing and availability of application via Traefik..."
41-
timeout 5m bash -c 'while ! curl -fsSLk "https://mattermost.heyvaldemar.net"; do echo "Waiting for the application to be ready..."; sleep 10; done'
59+
- name: Inspect Network Configuration
60+
run: |
61+
docker network inspect $NETWORK_ONE
62+
docker network inspect $NETWORK_TWO
4263
43-
- name: Inspect Network Configuration
44-
run: |
45-
docker network inspect mattermost-network
46-
docker network inspect traefik-network
64+
- name: Show container logs on failure
65+
if: failure()
66+
run: docker compose -f $DOCKER_COMPOSE_FILE -p $COMPOSE_PROJECT_NAME logs
4767

48-
- name: Shutdown Docker Compose services
49-
if: always()
50-
run: docker compose -f mattermost-traefik-letsencrypt-docker-compose.yml down
68+
- name: Shutdown Docker Compose services
69+
if: always()
70+
run: docker compose -f $DOCKER_COMPOSE_FILE -p $COMPOSE_PROJECT_NAME down

β€ŽREADME.md

+77-26
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ Deploy Mattermost using Docker Compose:
2222

2323
`docker compose -f mattermost-traefik-letsencrypt-docker-compose.yml -p mattermost up -d`
2424

25-
# Data Retention
25+
## Data Retention
2626

2727
Use the [script](https://github.com/heyValdemar/mattermost-data-retention-docker-compose) if you wish to set a data retention policy.
2828

29-
# Backups
29+
## Backups
3030

3131
The `backups` container in the configuration is responsible for the following:
3232

@@ -39,7 +39,7 @@ Customizable backup path, filename pattern, and schedule through variables like
3939

4040
By utilizing this container, 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.
4141

42-
# mattermost-restore-database.sh Description
42+
## mattermost-restore-database.sh Description
4343

4444
This script facilitates the restoration of a database backup:
4545

@@ -61,7 +61,7 @@ To make the `mattermost-restore-database.shh` script executable, run the followi
6161

6262
Usage of this script ensures a controlled and guided process to restore the database from an existing backup.
6363

64-
# mattermost-restore-application-data.sh Description
64+
## mattermost-restore-application-data.sh Description
6565

6666
This script is designed to restore the application data:
6767

@@ -83,31 +83,82 @@ To make the `mattermost-restore-application-data.sh` script executable, run the
8383

8484
By utilizing this script, you can efficiently restore application data from an existing backup while ensuring proper coordination with the running service.
8585

86-
# Author
86+
## Author
8787

88-
I’m Vladimir Mikhalev, the [Docker Captain](https://www.docker.com/captains/vladimir-mikhalev/), but my friends can call me Valdemar.
88+
hey everyone,
8989

90-
🌐 My [website](https://www.heyvaldemar.com/) with detailed IT guides\
91-
🎬 Follow me on [YouTube](https://www.youtube.com/channel/UCf85kQ0u1sYTTTyKVpxrlyQ?sub_confirmation=1)\
92-
🐦 Follow me on [Twitter](https://twitter.com/heyValdemar)\
93-
🎨 Follow me on [Instagram](https://www.instagram.com/heyvaldemar/)\
94-
🧡 Follow me on [Threads](https://www.threads.net/@heyvaldemar)\
95-
🐘 Follow me on [Mastodon](https://mastodon.social/@heyvaldemar)\
96-
🧊 Follow me on [Bluesky](https://bsky.app/profile/heyvaldemar.bsky.social)\
97-
🎸 Follow me on [Facebook](https://www.facebook.com/heyValdemarFB/)\
98-
πŸŽ₯ Follow me on [TikTok](https://www.tiktok.com/@heyvaldemar)\
99-
πŸ’» Follow me on [LinkedIn](https://www.linkedin.com/in/heyvaldemar/)\
100-
🐈 Follow me on [GitHub](https://github.com/heyvaldemar)
90+
πŸ’Ύ 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!
10191

102-
# Communication
92+
πŸ’› 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.
10393

104-
πŸ‘Ύ Chat with IT pros on [Discord](https://discord.gg/AJQGCCBcqf)\
105-
πŸ“§ Reach me at ask@sre.gg
94+
πŸš€ 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.
10695

107-
# Give Thanks
96+
🐳 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.
10897

109-
πŸ’Ž Support on [GitHub](https://github.com/sponsors/heyValdemar)\
110-
πŸ† Support on [Patreon](https://www.patreon.com/heyValdemar)\
111-
πŸ₯€ Support on [BuyMeaCoffee](https://www.buymeacoffee.com/heyValdemar)\
112-
πŸͺ Support on [Ko-fi](https://ko-fi.com/heyValdemar)\
113-
πŸ’– Support on [PayPal](https://www.paypal.com/paypalme/heyValdemarCOM)
98+
Let’s do this together!
99+
100+
## My 2D Portfolio
101+
102+
πŸ•ΉοΈ 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.
103+
104+
## My Courses
105+
106+
πŸŽ“ 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.
107+
108+
πŸ”‘ [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.
109+
110+
## My Services
111+
112+
πŸ’Ό 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!
113+
114+
## Patreon Exclusives
115+
116+
πŸ† 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.
117+
118+
## My Recommendations
119+
120+
πŸ“• Check out my collection of [essential DevOps books](https://kit.co/heyvaldemar/essential-devops-books)\
121+
πŸ–₯️ Check out my [studio streaming and recording kit](https://kit.co/heyvaldemar/my-studio-streaming-and-recording-kit)\
122+
πŸ“‘ Check out my [streaming starter kit](https://kit.co/heyvaldemar/streaming-starter-kit)
123+
124+
## Follow Me
125+
126+
🎬 [YouTube](https://www.youtube.com/channel/UCf85kQ0u1sYTTTyKVpxrlyQ?sub_confirmation=1)\
127+
🐦 [X / Twitter](https://twitter.com/heyvaldemar)\
128+
🎨 [Instagram](https://www.instagram.com/heyvaldemar/)\
129+
🐘 [Mastodon](https://mastodon.social/@heyvaldemar)\
130+
🧡 [Threads](https://www.threads.net/@heyvaldemar)\
131+
🎸 [Facebook](https://www.facebook.com/heyvaldemarFB/)\
132+
🧊 [Bluesky](https://bsky.app/profile/heyvaldemar.bsky.social)\
133+
πŸŽ₯ [TikTok](https://www.tiktok.com/@heyvaldemar)\
134+
πŸ’» [LinkedIn](https://www.linkedin.com/in/heyvaldemar/)\
135+
πŸ“£ [daily.dev Squad](https://app.daily.dev/squads/devopscompass)\
136+
🧩 [LeetCode](https://leetcode.com/u/heyvaldemar/)\
137+
🐈 [GitHub](https://github.com/heyvaldemar)
138+
139+
## Community of IT Experts
140+
141+
πŸ‘Ύ [Discord](https://discord.gg/AJQGCCBcqf)
142+
143+
## Refill My Coffee Supplies
144+
145+
πŸ’– [PayPal](https://www.paypal.com/paypalme/heyvaldemarCOM)\
146+
πŸ† [Patreon](https://www.patreon.com/heyvaldemar)\
147+
πŸ’Ž [GitHub](https://github.com/sponsors/heyvaldemar)\
148+
πŸ₯€ [BuyMeaCoffee](https://www.buymeacoffee.com/heyvaldemar)\
149+
πŸͺ [Ko-fi](https://ko-fi.com/heyvaldemar)
150+
151+
🌟 **Bitcoin (BTC):** bc1q2fq0k2lvdythdrj4ep20metjwnjuf7wccpckxc\
152+
πŸ”Ή **Ethereum (ETH):** 0x76C936F9366Fad39769CA5285b0Af1d975adacB8\
153+
πŸͺ™ **Binance Coin (BNB):** bnb1xnn6gg63lr2dgufngfr0lkq39kz8qltjt2v2g6\
154+
πŸ’  **Litecoin (LTC):** LMGrhx8Jsx73h1pWY9FE8GB46nBytjvz8g
155+
156+
<div align="center">
157+
158+
### Show some πŸ’œ by starring some of the [repositories](https://github.com/heyValdemar?tab=repositories)!
159+
160+
![octocat](https://user-images.githubusercontent.com/10498744/210113490-e2fad07f-4488-4da8-a656-b9abbdd8cb26.gif)
161+
162+
</div>
163+
164+
![footer](https://user-images.githubusercontent.com/10498744/210157572-1fca0242-8af2-46a6-bfa3-666ffd40ebde.svg)

0 commit comments

Comments
Β (0)