This guide explains how to deploy the application stack in a production environment using Traefik as a reverse proxy with Let's Encrypt SSL certificates.
- A server with Docker and Docker Compose installed
- A domain name (e.g.,
devopsterminal.com) with DNS access - Ports 80 and 443 open in your firewall
-
Update DNS Records Create the following DNS A records pointing to your server's IP address:
devopsterminal.comprojekt1.devopsterminal.comprojekt2.devopsterminal.comtraefik.devopsterminal.com
-
Update Configuration
- Update the email address in
docker-compose.prod.yml(search foradmin@devopsterminal.com) - Update the domain names if you're using a different domain than
devopsterminal.com - Change the default credentials for the Traefik dashboard (see below)
- Update the email address in
-
Change Default Credentials The default credentials for the Traefik dashboard are:
- Username:
admin - Password:
changeme
To generate a new password hash:
echo $(htpasswd -nb admin your-new-password) | sed -e s/\\$/\\$\$/g
Update the
traefik.http.middlewares.auth.basicauth.userslabel indocker-compose.prod.ymlwith the new hash. - Username:
-
Deploy the Stack
# Create the network if it doesn't exist podman network create prod_network # Create required directories mkdir -p letsencrypt traefik chmod 600 letsencrypt # Start the stack podman-compose -f docker-compose.prod.yml up -d
- Project 1: https://projekt1.devopsterminal.com
- Project 2: https://projekt2.devopsterminal.com
- Traefik Dashboard: https://traefik.devopsterminal.com (requires authentication)
Traefik logs are available in the container and also mounted to:
./traefik/traefik.log- Traefik service logs./traefik/access.log- Access logs
podman-compose -f docker-compose.prod.yml logs -fpodman-compose -f docker-compose.prod.yml pull
podman-compose -f docker-compose.prod.yml up -d --force-recreateBackup Let's Encrypt certificates:
tar -czvf letsencrypt_backup_$(date +%Y%m%d).tar.gz letsencrypt/Restore from backup:
tar -xzvf letsencrypt_backup_YYYYMMDD.tar.gz- Firewall: Ensure only necessary ports (80, 443) are open to the internet
- Updates: Regularly update your containers and host system
- Monitoring: Set up monitoring for your services
- Backups: Regularly back up your Let's Encrypt certificates and application data