feat(docker): 添加docker相关配置和文档

添加Dockerfile、.dockerignore、nginx.conf配置文件
新增docker.md文档说明构建和运行步骤
更新.vscode设置支持docker文件嵌套
This commit is contained in:
feige996
2025-09-17 10:37:59 +08:00
parent e5996b3b93
commit 4e3942eca8
6 changed files with 209 additions and 1 deletions

25
docker.md Normal file
View File

@@ -0,0 +1,25 @@
## Docker
根据提供的 `Dockerfile`,可以通过以下步骤构建并运行镜像:
### 1. 构建Docker镜像
在项目根目录执行以下命令:
- `-t unibest:v1-2025091701`:为镜像指定名称和标签
- `.`表示使用当前目录的Dockerfile
```bash
docker build -t unibest:v1-2025091701 .
```
### 2. 运行Docker容器
使用以下命令运行容器:
```bash
docker run -d -p 80:80 unibest:v1-2025091701
```
- `-d`:表示在后台运行容器
- `-p 80:80`将容器的80端口映射到主机的80端口