The related sharing was conducted via video at that time. Key information is briefly listed here, with the related video sharing attached below.
Requirements
dotnet tool install --global x
Initialize the Project
x new web Chinook
cd Chinook
x mix autocrudgen sqlite chinook.sqlite
# 改变 Configure.Db.cs
Deployment
# 服务器安装 docker, docker compose
# 生成 nginx 部署脚本
x mix build release-ghr-vanilla
# 上传到目标服务器执行
scp ./.deploy/nginx-proxy-compose.yml tencentCloud:~/nginx/nginx-proxy-compose.yml
cd ~/nginx
docker compose -f ./nginx-proxy-compose.yml up -d
# github action 相关变量
DEPLOY_HOST chinook.shubuzuo.top
DEPLOY_PORT 22
DEPLOY_USERNAME ubuntu
DEPLOY_KEY
LETSENCRYPT_EMAIL [email protected]
# 将当前用户添加到 docker 和 docker compose 中去
sudo usermod -aG docker $USER
sudo systemctl restart docker
Appendix: Installing docker and docker compose on ubuntu 22.04 LTS docker installation
You can install Docker and Docker Compose on Ubuntu by following these steps:
- Update your Ubuntu system. Open a terminal and run the following commands in sequence:
sudo apt update
sudo apt upgrade
sudo apt full-upgrade
- Add the Docker repository. First, install the necessary certificates and allow the apt package manager to use the repository over HTTPS by running the following command:
sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg lsb-release
Then, run the following command to add Docker's official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
Add the official Docker repository:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
Update the Ubuntu source list using the command:
sudo apt update
- Install Docker. Finally, run the following command to install the latest Docker CE on an Ubuntu 22.04 LTS server:
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Video Address
You can find more detailed information in this article¹. I hope this information is helpful to you!
Source: Conversation with Bing, 2023/7/3
Comments (0)
No comments yet. Be the first to leave one!