Skip to content

Latest commit

 

History

History
86 lines (58 loc) · 1.06 KB

File metadata and controls

86 lines (58 loc) · 1.06 KB

hexo-docker

Docker Hub

Build

docker build -t hexo-docker .

My docker hub tag docker tag hexo-docker:latest chanchun/hexo-docker:latest

Run

docker run -v $(pwd)/letsencrypt:/etc/letsencrypt -d -p 80:80 -p 443:443 -p 8004:22 hexo-docker

Setting

First enter docker container

docker exec -it "[your_container_name]" /bin/bash

Let’s Encypt Setting

Creat certificate

certbot --nginx -d "[your_domain.com]"

Renew the certificate when it is about to expire

/usr/bin/certbot renew

Hexo Setting

mkdir ~/.ssh
echo "[your_ssh_public_key]" > ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh
mkdir /run/sshd
/usr/sbin/sshd

Hexo Deploy

Hexo _config.yml

deploy:
  type: git
  repo: root@hexo-test:/root/blogs.git
  branch: master

~/.ssh/config

Host hexo-test
  HostName [your_remote_server_ip]
  Port 8004