diff --git a/ghost/README.md b/ghost/README.md index bd850b7..df534e3 100644 --- a/ghost/README.md +++ b/ghost/README.md @@ -7,9 +7,11 @@ ghost ```yaml ghost: - image: ghost + image: ghost:alpine ports: - "127.0.0.1:2368:2368" + volumes: + - ./data:/var/lib/ghost restart: always ``` @@ -17,11 +19,9 @@ ghost: ```bash $ docker-compose up -d -$ docker-compose exec ghost bash ->>> cd /var/lib/ghost/ ->>> sed -i 's@http://localhost:2368@https://blog.easypi.info@' config.js ->>> grep -rIl 'googleapis' core content | xargs sed -i 's/googleapis/useso/g' ->>> exit +$ cd data +$ sed -i 's@http://localhost:2368@https://blog.easypi.info@' config.js +$ grep -rIl 'googleapis' core content | xargs sed -i 's/googleapis/useso/g' $ docker-compose restart ``` diff --git a/ghost/arm/Dockerfile b/ghost/arm/Dockerfile index 57336fa..a6310b8 100644 --- a/ghost/arm/Dockerfile +++ b/ghost/arm/Dockerfile @@ -5,7 +5,7 @@ FROM easypi/alpine-arm MAINTAINER EasyPi Software Foundation -ENV GHOST_VER 0.11.3 +ENV GHOST_VER 0.11.8 ENV GHOST_URL https://ghost.org/archives/ghost-$GHOST_VER.zip ENV GHOST_SOURCE /usr/src/ghost ENV GHOST_CONTENT /var/lib/ghost diff --git a/ghost/arm/docker-compose.yml b/ghost/arm/docker-compose.yml index ae2167f..b1d1b6d 100644 --- a/ghost/arm/docker-compose.yml +++ b/ghost/arm/docker-compose.yml @@ -1,5 +1,7 @@ ghost: image: easypi/ghost-arm ports: - - "2368:2368" + - "127.0.0.1:2368:2368" + volumes: + - ./data:/var/lib/ghost restart: always diff --git a/ghost/docker-compose.yml b/ghost/docker-compose.yml index 6c01c5d..c90024b 100644 --- a/ghost/docker-compose.yml +++ b/ghost/docker-compose.yml @@ -1,5 +1,7 @@ ghost: - image: ghost + image: ghost:alpine ports: - "127.0.0.1:2368:2368" + volumes: + - ./data:/var/lib/ghost restart: always diff --git a/nginx/README.md b/nginx/README.md index 1b2db6b..63b1693 100644 --- a/nginx/README.md +++ b/nginx/README.md @@ -11,38 +11,38 @@ IMAP protocols, as well as a load balancer, HTTP cache, and a web server File: docker-compose.yml -``` +```yaml nginx: - image: vimagick/nginx + image: nginx:alpine ports: - "80:80" volumes: - - ./nginx/nginx.conf:/etc/nginx/nginx.conf - - ./html:/usr/share/nginx/html + - ./data/default.conf:/etc/nginx/default.conf + - ./data/html:/usr/share/nginx/html restart: always ``` -## Website Proxy +## Reverse Proxy File: docker-compose.yml -``` +```yaml nginx: - image: nginx:latest + image: nginx:alpine volumes: - - ./nginx/nginx.conf:/etc/nginx/nginx.conf - - ./nginx/sites-enabled/default:/etc/nginx/sites-enabled/default - - ./nginx/htpasswd:/etc/nginx/htpasswd + - ./data/default.conf:/etc/nginx/conf.d/default.conf + - ./data/ssl:/etc/nginx/ssl + - ./data/htpasswd:/etc/nginx/htpasswd net: host restart: always ``` > Password file can be generated by: ->> `htpasswd -b -c ./nginx/htpasswd username password` +>> `echo "username:$(openssl passwd -apr1 password)" >> data/htpasswd` File: nginx.conf -``` +```nginx user nginx; worker_processes 4; @@ -79,7 +79,7 @@ http { File: default -``` +```nginx server { listen 80 default; server_name _; @@ -118,7 +118,7 @@ server { File: [rtmp][1] -``` +```nginx rtmp { server { listen 1935; diff --git a/nginx/data/default.conf b/nginx/data/default.conf new file mode 100644 index 0000000..c60f1ab --- /dev/null +++ b/nginx/data/default.conf @@ -0,0 +1,23 @@ +server { + listen 80 default_server; + server_name _; + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl; + server_name blog.easypi.info; + ssl_certificate ssl/easypi.info/fullchain.pem; + ssl_certificate_key ssl/easypi.info/privkey.pem; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers HIGH:!aNULL:!MD5; + location / { + proxy_pass http://127.0.0.1:2368; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + } +} diff --git a/nginx/docker-compose.yml b/nginx/docker-compose.yml index 21c7808..c4b7263 100644 --- a/nginx/docker-compose.yml +++ b/nginx/docker-compose.yml @@ -1,8 +1,7 @@ nginx: - image: vimagick/nginx - ports: - - "80:80" + image: nginx:alpine volumes: - - ./nginx/nginx.conf:/etc/nginx/nginx.conf - - ./html:/usr/share/nginx/html + - ./data/default.conf:/etc/nginx/conf.d/default.conf + - ./data/ssl:/etc/nginx/ssl + net: host restart: always