56 lines
1015 B
Markdown
56 lines
1015 B
Markdown
# 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
|
|
|
|
```bash
|
|
nano nginx-proxy/nginx.conf
|
|
```
|
|
|
|
/\ Attention, le nom de domaine est à configuré dans le proxy NGINX !
|
|
|
|
### Pour le HTTPS:
|
|
|
|
Via Certbot:
|
|
```bash
|
|
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:
|
|
|
|
```bash
|
|
sudo systemctl restart nginx
|
|
```
|
|
|
|
## BUILD
|
|
|
|
```bash
|
|
hugo
|
|
```
|
|
|
|
## START
|
|
|
|
### DOCKER
|
|
|
|
```bash
|
|
docker build -t hugo/hugo-site .
|
|
docker run -d -p 6666:80 --name hugo-site hugo/hugo-site
|
|
```
|
|
|
|
### DOCKER-COMPOSE
|
|
|
|
```bash
|
|
docker-compose up -d
|
|
```
|