J’ai dû mettre à jour ~/proxy/nginx.tmpl
pour récupérer ce commit — ce ne sera pas nécessaire lorsqu’une nouvelle image sera disponible.
Mettre à jour ~/proxy/docker-compose.yml
pour ajouter un volume qui lie les certificats de la machine hôte au container. J’ajoute également mon nginx.tmpl
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./nginx.tmpl:/app/nginx.tmpl
- /etc/letsencrypt:/etc/letsencrypt:ro
Mettre à jour les variables d’environnement dans ~/nginx/docker-compose.yml
pour que Nginx-proxy gère le certificat wildcard correctement:
environment:
- VIRTUAL_HOST=www.a-mt.xyz
- CERT_PATHNAME=/etc/letsencrypt/live/a-mt.xyz/fullchain.pem
- PRIVATE_KEY_PATHNAME=/etc/letsencrypt/live/a-mt.xyz/privkey.pem
- HTTPS_METHOD=noredirect
Je veux également pouvoir accéder au site web via http://IPADDRESS:8081
, je vais donc mettre à jour les configs Nginx pour pouvoir utiliser le certificat SSL sans passer par Nginx-proxy. Ces étapes ne sont pas indispensables.
~/nginx/default.conf
Mettre à jour ~/nginx/docker-compose.yml
volumes:
- ./html:/usr/share/nginx/html
- /etc/letsencrypt:/etc/letsencrypt:ro
- ./default.conf:/etc/nginx/conf.d/default.conf
ports:
- "8080:80"
- "8081:443"
Mettre à jour les variables d’environnement dans ~/diary/docker-compose.yml
environment:
- VIRTUAL_HOST: diary.a-mt.xyz
- CERT_PATHNAME: /etc/letsencrypt/live/a-mt.xyz/fullchain.pem
- PRIVATE_KEY_PATHNAME: /etc/letsencrypt/live/a-mt.xyz/privkey.pem
- HTTPS_METHOD: noredirect
- ...
Même principe qu’avec Nginx, je veux pouvoir accéder au site via http://IPADDRESS:8083
~/diary/default-ssl.conf
Mettre à jour ~/diary/docker-compose.yml
volumes:
- /etc/letsencrypt:/etc/letsencrypt:ro
- ./default-ssl.conf:/etc/apache2/sites-available/default-ssl.conf
ports:
- "8082:80"
- "8083:443"