first commit
Some checks failed
Build and Deploy / deploy (push) Has been cancelled
Build and Deploy / build (push) Has been cancelled

This commit is contained in:
2026-01-23 09:59:19 +01:00
commit 2eddd152d7
17 changed files with 1895 additions and 0 deletions

68
traefik-example/README.md Normal file
View File

@@ -0,0 +1,68 @@
# Esempio Configurazione Traefik
Questa directory contiene un esempio di configurazione Traefik per il server di produzione.
## Setup Iniziale
1. Crea la directory sul server:
```bash
mkdir -p /opt/traefik/letsencrypt
cd /opt/traefik
```
2. Copia il file docker-compose.yml in questa directory
3. Modifica l'email per Let's Encrypt:
```bash
nano docker-compose.yml
# Modifica: tua-email@example.com
```
4. Crea la rete Docker:
```bash
docker network create traefik-network
```
5. Avvia Traefik:
```bash
docker-compose up -d
```
6. Verifica che sia attivo:
```bash
docker ps
docker logs traefik
```
## Note di Sicurezza
- **Dashboard**: La configurazione include il dashboard Traefik con autenticazione basic
- Per generare una nuova password per il dashboard:
```bash
# Installa htpasswd se necessario: apt-get install apache2-utils
htpasswd -nb admin tuapassword
```
- In produzione, considera di rimuovere completamente il dashboard o limitarlo a IP specifici
## Configurazione Domini
Dopo aver avviato Traefik, i tuoi container con le labels corrette saranno automaticamente esposti con:
- Certificati SSL Let's Encrypt
- Redirect automatico HTTP → HTTPS
- Routing basato sul dominio
## Troubleshooting
### Certificati non vengono generati
- Verifica che la porta 80 sia accessibile pubblicamente
- Controlla i logs: `docker logs traefik`
- Verifica che il dominio punti all'IP del server
- Assicurati che il file `acme.json` abbia i permessi corretti:
```bash
chmod 600 letsencrypt/acme.json
```
### Container non raggiungibili
- Verifica che il container sia sulla rete `traefik-network`
- Controlla i logs di Traefik per errori
- Verifica le labels del container con: `docker inspect nome-container`