hugo-site/README.md
2021-07-24 11:26:08 +02:00

1015 B

HUGO SITE AVEC DOCKER

Cette branche à pour but de conteneurisé un site HUGO compilé avec un server NGINX. La configuration pour le NGINX reverse proxy en front se trouve dans le dossir nginx-proxy.

CONFIG

nano nginx-proxy/nginx.conf

/\ Attention, le nom de domaine est à configuré dans le proxy NGINX !

Pour le HTTPS:

Via Certbot:

sudo apt install certbot -y
sudo certbot certonly -d example.com

Une fois le certificat obtenu, décommenter les 3 lignes concernant le SSL en vérifiant le nom des certificats en fonction du nom de domaine:

   #ssl on;
   #ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
   #ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;

Redémarrer NGINX:

sudo systemctl restart nginx

BUILD

hugo

START

DOCKER

docker build -t hugo/hugo-site .
docker run -d -p 6666:80 --name hugo-site hugo/hugo-site

DOCKER-COMPOSE

docker-compose up -d