chore: migrate project to monorepo
This commit is contained in:
1 parent
47dd739a28
commit
9195a387b2
125 files changed
+1478
-1364
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 36 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 52 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 77 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 71 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"label": "docker工具",
|
||||
"position": 7,
|
||||
"link": {
|
||||
"type": "generated-index"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# docker的安装与验证
|
||||
docker是一种开源平台,用于开发、部署和运行应用程序。
|
||||
|
||||
## 先决条件
|
||||
1. 确保您的系统是windows专业版
|
||||
2. 已安装了wsl2
|
||||
|
||||
>**提示**
|
||||
如果没有安装wsl2,可以参考[安装wsl文档](https://learn.microsoft.com/zh-cn/windows/wsl/install)
|
||||
|
||||
## docker的安装
|
||||
### 1. 开启windows功能
|
||||
通过控制面板,开启Hyper-v和适用于windows子系统功能
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### 2. 下载并安装docker
|
||||
下载docker最安全的路径就是去官网,安装时要注意勾选`wsl`选项,安装成功后跳过登录docker Hub账号
|
||||
```
|
||||
https://docs.docker.com/desktop/install/windows-install/
|
||||
```
|
||||
|
||||
## 配置Docker镜像
|
||||
安装docker后,进入docker,开始配置镜像
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
配置镜像添加以下内容
|
||||
```
|
||||
"registry-mirrors":["https://docker.m.daocloud.io","https://docker.1panel.live"]
|
||||
```
|
||||
|
||||
## 验证Docker
|
||||
运行以下命令,测试Docker是否正确安装并运行
|
||||
```
|
||||
docker run hello-world
|
||||
```
|
||||
当输出`Hello from Docker`命令时,表明Docker安装正确
|
||||

|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
# Docker启动数据库
|
||||
使用Docker启动PostgreSQL数据库
|
||||
|
||||
## 先决条件
|
||||
1. 已安装Docker
|
||||
2. 以wsl为开发环境
|
||||
|
||||
## 拉取 PostgreSQL 镜像
|
||||
在wsl中,运行以下命令来拉取 `PostgreSQL` 镜像:
|
||||
```
|
||||
sudo docker pull postgres
|
||||
```
|
||||
|
||||
## 创建文件并启动容器
|
||||
### 1. 创建`docker-compose.yml`文件
|
||||
运行以下命令,创建`docker-compose.yml`文件
|
||||
```
|
||||
touch docker-compose.yml
|
||||
```
|
||||
### 2. 编写文件
|
||||
在`docker-compose.yml`文件中,写入以下内容:
|
||||
```
|
||||
version: '3.9'
|
||||
|
||||
services:
|
||||
|
||||
db:
|
||||
image: postgres
|
||||
restart: always
|
||||
shm_size: 128mb
|
||||
environment:
|
||||
POSTGRES_PASSWORD: example
|
||||
ports:
|
||||
- "5432:5432"
|
||||
|
||||
adminer:
|
||||
image: adminer
|
||||
restart: always
|
||||
ports:
|
||||
- 7897:8080
|
||||
```
|
||||
### 3. 启动`PostgreSQL`数据库
|
||||
运行以下命令启动`PostgreSQL`数据库:
|
||||
```
|
||||
docker-compose up --build
|
||||
```
|
||||
|
||||
### 4. 验证启动
|
||||
运行以下命令`ps`,当STATUS出现`up`的时候,容器就表示启动成功
|
||||
```
|
||||
docker ps
|
||||
```
|
||||

|
||||
|
||||
### 5. 连接到PostgreSQL数据库
|
||||
运行以下命令,连接到PostgreSQL数据库:
|
||||
```
|
||||
docker exec -it my-postgres psql -U postgres
|
||||
```
|
||||
|
||||
Reference in new issue
Block a user