# install docker
# https://www.runoob.com/docker/ubuntu-docker-install.html
curl -sSL https://get.daocloud.io/docker | sh

# install docker-compose
# http://www.ppmy.cn/news/3878.html
apt -y install docker-compose
# 安装指定版本的docker-compose https://blog.csdn.net/qq_39626154/article/details/82753412
# curl -L https://github.com/docker/compose/releases/download/1.12.0/docker-compose-`uname -s`-`uname -m` -o /usr/bin/docker-compose
# chmod +x /usr/bin/docker-compose
apt -y install python-pip

# config docker image source
# https://blog.csdn.net/whatday/article/details/86770609/
echo { \
    \"registry-mirrors\": [ \
        \"http://hub-mirror.c.163.com\", \
        \"https://docker.mirrors.ustc.edu.cn\", \
        \"https://registry.docker-cn.com\" \
    ] \
} > /etc/docker/daemon.json

service docker restart

docker info

# install curl
apt -y install curl

# install nginx
apt -y install nginx


# acme.sh
# https://blog.csdn.net/Dancen/article/details/121044863
# https://github.com/acmesh-official/acme.sh
# download from github
# install acme.sh
chmod +x acme.sh
./acme.sh --install -m zeng32@qq.com
# change to ~/.acme.sh
cd ~/.acme.sh
# change default ca
./acme.sh  --set-default-ca --server letsencrypt

# ali key and secret
export Ali_Key="xxxxxxxxx"

export Ali_Secret="xxxxxxxxxxxxxxxx"

# generate ssl cert under DNS auto mode
./acme.sh --issue --dns dns_ali -d gitea.windymuse.com.cn
