Skip to content

Commit 3b185ee

Browse files
committed
fix: docker 镜像挂载 volume 导致程序被覆盖
1 parent 6d44739 commit 3b185ee

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,5 +366,6 @@ FodyWeavers.xsd
366366
.env.*
367367
.lh
368368

369-
# docker 镜像的 working 文件夹
370-
/working
369+
# docker 镜像的文件夹
370+
/working
371+
/cache

CSharp-OpenBMCLAPI/Modules/Config.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ public Config()
7575
this.skipCheck = false;
7676

7777
this.refreshTokenTime = 1800000;
78-
this.clusterWorkingDirectory = "./";
79-
this.clusterFileDirectory = "./";
78+
this.clusterWorkingDirectory = "./working";
79+
this.clusterFileDirectory = "./cache";
8080
this.clusterVersion = "1.10.8";
8181

8282
this.HOST = "";

CSharp-OpenBMCLAPI/Modules/Storage/FileStorage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace CSharpOpenBMCLAPI.Modules.Storage
1414
public class FileStorage : IStorage
1515
{
1616
protected string workingDirectory;
17-
public string CacheDirectory { get => Path.Combine(workingDirectory, "cache"); }
17+
public string CacheDirectory { get => workingDirectory; }
1818
private SambaConnection? connection;
1919

2020
public FileStorage(string workingDirectory)

Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
44
# 设置工作目录
55
WORKDIR /app
66

7-
# 复制项目文件到工作目录
8-
COPY . .
9-
107
# 恢复项目依赖项
118
RUN dotnet restore
129

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ services:
55
ports:
66
- 4000:4000
77
volumes:
8-
- ./working:/app
8+
- ./working:/app/working
9+
- ./cache:/app/cache

0 commit comments

Comments
 (0)