feat: 支持docker

This commit is contained in:
橙子
2025-02-09 22:23:23 +08:00
parent c0dfa83828
commit ed873da3b6
6 changed files with 100 additions and 4 deletions

View File

@@ -3,6 +3,16 @@
## 后端
执行目录Yi\Yi.Abp.Net8
#### 启动
D:/code/csharp/source/Yi/Yi.Bbs.Vue3/yi-bbs.conf 为我的配置文件,内部带了默认的配置文件,根据自己配置进行更改
//不带配置文件
docker run -d --name yi.admin -p 19001:19001 jiftcc/yi.admin:1.0.0
//带配置文件
docker run -d --name yi.admin -p 19001:19001 -v D:/code/csharp/source/Yi/Yi.Abp.Net8/src/Yi.Abp.Web/appsettings.json:/app/appsettings.json jiftcc/yi.admin:1.0.0
#### 完整代码编译
docker build -t jiftcc/yi.admin:1.0.0 -f Dockerfile .
@@ -12,11 +22,17 @@ docker build -t jiftcc/yi.admin:1.0.0 -f DockerfileFast .
## 前端(待完善)
## 前端
执行目录Yi\Yi.Bbs.Vue3
#### 启动
D:/code/csharp/source/Yi/Yi.Bbs.Vue3/yi-bbs.conf 为我的conf配置目录默认反向代理到ccnetcore.com根据自己后端地址进行修改配置
docker run -d --name yi.bbs -p 18001:18001 -v D:/code/csharp/source/Yi/Yi.Bbs.Vue3/yi-bbs.conf:/etc/nginx/conf.d/yi-bbs.conf jiftcc/yi.bbs:1.0.0
#### 完整代码编译
docker build -t jiftcc/yi.bbs:1.0.0 -f Dockerfile .
#### 快速产物编译
docker build -t jiftcc/yi.bbs:1.0.0 -f DockerfileFast .

View File

@@ -35,6 +35,16 @@ A Comprehensive Solution, Ultimately Just Another Wheel.
- Yi.RuoYi.Vue3RuoYi JS Backend Frontend
****
## 🍉 docker
Full contentREADME-Docker.md
backend`docker run -d --name yi.admin -p 19001:19001 jiftcc/yi.admin:last`
bbs frontend`docker run -d --name yi.bbs -p 18001:18001 -v /home/Yi/Yi.Bbs.Vue3/yi-bbs.conf:/etc/nginx/conf.d/yi-bbs.conf jiftcc/yi.bbs:last`
****
## 🍊 Official website and demo link

View File

@@ -41,6 +41,15 @@ Yi框架-一套与SqlSugar一样爽的.Net8开源框架。
- Yi.Pure.Vue3Pure ts后台前端
- Yi.RuoYi.Vue3RuoYi js后台前端
****
## 🍉 docker 一键启动
完整内容在README-Docker.md
后端:`docker run -d --name yi.admin -p 19001:19001 jiftcc/yi.admin:last`
bbs前端`docker run -d --name yi.bbs -p 18001:18001 -v /home/Yi/Yi.Bbs.Vue3/yi-bbs.conf:/etc/nginx/conf.d/yi-bbs.conf jiftcc/yi.bbs:last`
****
## 🍊 官网及演示地址:
@@ -60,6 +69,7 @@ Pure后台演示地址https://ccnetcore.com:1001 用户cc、密码123456
- [x] 完全支持微服务架构
****
## 🍇 详细到爆炸的Yi框架教程导航
1. [框架快速开始教程](https://ccnetcore.com/article/aaa00329-7f35-d3fe-d258-3a0f8380b742)(已完成)

33
Yi.Bbs.Vue3/.dockerignore Normal file
View File

@@ -0,0 +1,33 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md
!**/.gitignore
!.git/HEAD
!.git/config
!.git/packed-refs
!.git/refs/heads/**
appsettings.Development.json
appsettings.Production.json
appsettings.Staging.json

View File

@@ -1,5 +1,4 @@
FROM nginx as base
COPY nginx.conf /etc/nginx/nginx.conf
FROM nginx:stable-alpine3.20-perl as base
EXPOSE 18001
FROM node:20.18 as publish
@@ -10,5 +9,5 @@ RUN npm run build
FROM base AS final
WORKDIR /app
COPY --from=publish /dist/* .
COPY --from=publish /main/dist/ .
ENTRYPOINT ["nginx", "-g", "daemon off;"]

28
Yi.Bbs.Vue3/yi-bbs.conf Normal file
View File

@@ -0,0 +1,28 @@
server {
client_header_buffer_size 10k;
large_client_header_buffers 40 40k;
listen 18001;
server_name _;
client_max_body_size 100m;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
location /{
root /app;
index index.html;
try_files $uri $uri/ /index.html;
}
location /prod-api/ {
proxy_pass http://ccnetcore.com:19001/api/app/;
}
location /prod-ws/ {
proxy_pass http://ccnetcore.com:19001/hub/;
}
}