-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
144 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
## ubuntu说明 | ||
``` | ||
//安装工具 | ||
apt-get install xxxx | ||
``` | ||
|
||
## 准备安装docker | ||
- 参考 https://juejin.cn/post/7314968141280051240?searchId=20231228192336770F203FBB57DC35F323 | ||
|
||
``` | ||
// 更新包索引并安装添加新 HTTPS 存储库所需的依赖项 | ||
sudo apt update | ||
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common | ||
//添加 Docker 的官方 GPG 密钥 | ||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | ||
// 添加Docker存储库 | ||
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | ||
// 更新软件包索引并安装 Docker Engine | ||
sudo apt-get update | ||
sudo apt-get install docker-ce docker-ce-cli containerd.io | ||
``` | ||
|
||
## 开启Docker | ||
``` | ||
// 启动docker守护进程 | ||
systemctl start docker | ||
// 配置让docker服务岁系统自动启动 | ||
systemctl enable docker | ||
// 取消开机自动启动 | ||
systemctl disable docker | ||
// 停止docker服务 | ||
systemctl stop docker | ||
// 查看docker版本,确认docker是否安装成功 | ||
docker version | ||
``` | ||
|
||
|
||
## 安装git | ||
``` | ||
// 安装git | ||
apt-get install git | ||
// 查看git版本 | ||
git version | ||
// 查看OpenSSH版本 | ||
ssh -V | ||
// 生成ssh密钥对 | ||
ssh-keygen -t rsa -b 4096 | ||
// 一路默认即可,生成 | ||
// 生成的路径一般在/root/.ssh/ | ||
// 查看 | ||
ls -li | ||
920236 -rw------- 1 root root 406 Dec 28 19:12 authorized_keys | ||
919704 -rw------- 1 root root 3369 Dec 28 19:39 id_rsa | ||
919708 -rw-r--r-- 1 root root 737 Dec 28 19:39 id_rsa.pub | ||
一般是将id_rsa.pub拷贝到服务器或者直接将里面的长字符串进行配置后使用 | ||
我这里是将id_rsa.pub 拷贝到了github上用来拉去项目的 | ||
``` | ||
|
||
## 准备mysql redis rabbitmq | ||
``` | ||
cd /root | ||
mkdir docker | ||
cd docker | ||
mkdir redis | ||
mkdir mysql | ||
mkdir rabbitmq | ||
``` | ||
|
||
## redis 配置 | ||
- 配置文件位置 | ||
- 英文版 https://raw.githubusercontent.com/antirez/redis/7.0/redis.conf | ||
- 中文版 https://juejin.cn/post/7316794084998348851?searchId=20231228200452F893C938CCCBA53BD65F | ||
|
||
我这里主要修改了 | ||
- 英文版中的requirepass密码 然后拷贝到/root/docker/redis/conf中去了 | ||
- # bind 127.0.0.1 -::1 将这一行暂时注释掉 | ||
|
||
``` | ||
docker run --restart=always \ | ||
-p 6379:6379 \ | ||
--name redis \ | ||
-e "TZ=Asia/Shanghai" \ | ||
-v /root/docker/redis/conf/redis.conf:/etc/redis/redis.conf \ | ||
-v /root/docker/redis/data:/data \ | ||
-itd redis:7.0.12 redis-server /etc/redis/redis.conf | ||
``` | ||
|
||
## mysql配置 | ||
- https://www.jianshu.com/p/e8a4ac2a92e0 | ||
``` | ||
docker run --name mysql \ | ||
--restart always \ | ||
--privileged=true \ | ||
-p 13306:3306 \ | ||
-v /root/docker/mysql/log:/var/log/mysql \ | ||
-v /root/docker/mysql/conf/my.cnf:/etc/mysql/my.cnf \ | ||
-v /root/docker/mysql/data:/var/lib/mysql \ | ||
-e MYSQL_ROOT_PASSWORD="M9y2512!" \ | ||
-e MYSQL_USER="root" \ | ||
-e MYSQL_PASSWORD="M9y2512!" \ | ||
-d mysql:8.0 | ||
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'M9y2512!'; | ||
FLUSH PRIVILEGES; | ||
``` | ||
|
||
|
||
## git拉取项目 | ||
``` | ||
cd /root | ||
// 创建目录,并cd过去 | ||
mkdir github | ||
cd github | ||
//克隆项目 | ||
git clone [email protected]:aehyok/NET8.0.git | ||
//给脚本授权 | ||
chmod 777 run.sh | ||
``` |