Merge branch 'dev' of https://git.nxsir.cn/ql/ql_billing_system_backend into dev
This commit is contained in:
commit
77e234292c
@ -1,4 +1,4 @@
|
|||||||
using Apimanager_backend.Dtos;
|
using Apimanager_backend.Dtos;
|
||||||
using Apimanager_backend.Exceptions;
|
using Apimanager_backend.Exceptions;
|
||||||
using Apimanager_backend.Models;
|
using Apimanager_backend.Models;
|
||||||
using Apimanager_backend.Services;
|
using Apimanager_backend.Services;
|
||||||
|
|||||||
23
Apimanager_backend/Dockerfile
Normal file
23
Apimanager_backend/Dockerfile
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# 使用微软官方的 .NET 8.0 SDK 镜像作为构建阶段
|
||||||
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# 复制项目文件并还原依赖
|
||||||
|
COPY *.csproj ./
|
||||||
|
RUN dotnet restore
|
||||||
|
|
||||||
|
# 复制项目所有文件并发布(发布到 /app/publish)
|
||||||
|
COPY . ./
|
||||||
|
RUN dotnet publish -c Release -o /app/publish
|
||||||
|
|
||||||
|
# 使用更小的运行时镜像运行发布的应用
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=build /app/publish ./
|
||||||
|
|
||||||
|
# 设置环境变量为 Development
|
||||||
|
ENV ASPNETCORE_ENVIRONMENT=Development
|
||||||
|
# 声明容器将监听端口
|
||||||
|
EXPOSE 8080
|
||||||
|
# 容器启动时执行应用
|
||||||
|
ENTRYPOINT ["dotnet", "Apimanager_backend.dll"]
|
||||||
@ -60,7 +60,7 @@ if (app.Environment.IsDevelopment())
|
|||||||
app.UseSwaggerUI();
|
app.UseSwaggerUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
app.UseHttpsRedirection();
|
//app.UseHttpsRedirection();
|
||||||
|
|
||||||
app.UseCors("AllowAll");
|
app.UseCors("AllowAll");
|
||||||
app.UseAuthentication();
|
app.UseAuthentication();
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
},
|
},
|
||||||
"AllowedHosts": "*",
|
"AllowedHosts": "*",
|
||||||
"ConnectionStrings": {
|
"ConnectionStrings": {
|
||||||
"DefaultConnection": "server=192.168.5.100;username=root;password=768788dyw;port=3306;database=api_billing_system;SslMode=Preferred;"
|
"DefaultConnection": "server=192.168.5.100;username=root;password=768788Dyw;port=3306;database=api_billing_system;SslMode=Preferred;"
|
||||||
},
|
},
|
||||||
"JwtSettings": {
|
"JwtSettings": {
|
||||||
"Secret": "deXtdXode6hv0SI1o6xRw1ALkn0vYsWn",
|
"Secret": "deXtdXode6hv0SI1o6xRw1ALkn0vYsWn",
|
||||||
@ -17,7 +17,7 @@
|
|||||||
"RefreshTokenExpiryDays": 7
|
"RefreshTokenExpiryDays": 7
|
||||||
},
|
},
|
||||||
"redis": {
|
"redis": {
|
||||||
"ConnectionString": "192.168.5.100:6379"
|
"ConnectionString": "192.168.5.100:6379,abortConnect=false"
|
||||||
},
|
},
|
||||||
"EmailSettings": {
|
"EmailSettings": {
|
||||||
"Server": "smtp.exmail.qq.com",
|
"Server": "smtp.exmail.qq.com",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user