diff --git a/README.md b/README.md index a5be73c..3a160f0 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ # HugoPoi's blog deploy documentation -* Some deploy code +1. Get the assets + `rsync -a -C --progress home.hugopoi.net:/var/www/my_webapp/www/.content.EZtzwPjb/binary www/.content.EZtzwPjb` + I should put this in git lfs + +## Local mode + +1. `hugo` +1. `docker compose up` + +## Dev mode with hugo live reload + +1. `export UID GID=$(id -g)` +1. `docker compose -f docker-compose.yml -f docker-compose.dev.yml up` +1. Go to the [home](http://localhost:8080/) + diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 0000000..cc585bf --- /dev/null +++ b/docker-compose.dev.yml @@ -0,0 +1,13 @@ +version: "3" + +services: + web: + volumes: + - ./docker-nginx-conf/enable-hugo-reverse-proxy.conf:/etc/nginx/enable-hugo-reverse-proxy.conf + hugo: + image: frankywahl/hugo + working_dir: "/app/v2" + user: "${UID}:${GID}" + volumes: + - ./:/app + command: server --buildDrafts --bind 0.0.0.0 diff --git a/docker-compose.yml b/docker-compose.yml index c610c34..31ab15f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: - "8080:80" volumes: - ./www:/var/www/html - - ./nginx.conf:/etc/nginx/conf.d/default.conf + - ./docker-nginx-conf/default.conf:/etc/nginx/conf.d/default.conf php-fpm: image: php:8-fpm volumes: diff --git a/nginx.conf b/docker-nginx-conf/default.conf similarity index 89% rename from nginx.conf rename to docker-nginx-conf/default.conf index e996a58..63eb2f3 100644 --- a/nginx.conf +++ b/docker-nginx-conf/default.conf @@ -5,6 +5,9 @@ server { # access_log /var/log/nginx/access.log; root /var/www/html; try_files $uri $uri/ /index.php; + + include /etc/nginx/enable-hugo-reverse-proxy.conf* ; + location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass php-fpm:9000; diff --git a/docker-nginx-conf/enable-hugo-reverse-proxy.conf b/docker-nginx-conf/enable-hugo-reverse-proxy.conf new file mode 100644 index 0000000..451a1ee --- /dev/null +++ b/docker-nginx-conf/enable-hugo-reverse-proxy.conf @@ -0,0 +1,3 @@ + location /v2 { + proxy_pass http://hugo:1313/v2; + }