diff --git a/.github/workflows/docker-build_push.yml b/.github/workflows/docker-build_push.yml index 1970d5a..94314d5 100644 --- a/.github/workflows/docker-build_push.yml +++ b/.github/workflows/docker-build_push.yml @@ -39,7 +39,8 @@ jobs: - name: Build and push uses: docker/build-push-action@v5 with: - context: ./KernelMemory.FileWatcher + #context: ./KernelMemory.FileWatcher + #dockerfile: ./KernelMemory.FileWatcher/Dockerfile push: true platforms: linux/amd64,linux/arm64 labels: ${{ steps.meta.outputs.labels }} diff --git a/KernelMemory.FileWatcher/Dockerfile b/Dockerfile similarity index 53% rename from KernelMemory.FileWatcher/Dockerfile rename to Dockerfile index 01d0869..7549cdc 100644 --- a/KernelMemory.FileWatcher/Dockerfile +++ b/Dockerfile @@ -9,13 +9,17 @@ WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build ARG BUILD_CONFIGURATION=Release WORKDIR /src -COPY ["./KernelMemory.FileWatcher.csproj", "./"] -RUN dotnet restore ./KernelMemory.FileWatcher.csproj -COPY . ./ -RUN dotnet publish "./KernelMemory.FileWatcher.csproj" -c $BUILD_CONFIGURATION -o /app/publish +COPY ["KernelMemory.FileWatcher/KernelMemory.FileWatcher.csproj", "KernelMemory.FileWatcher/"] +RUN dotnet restore "./KernelMemory.FileWatcher/./KernelMemory.FileWatcher.csproj" +COPY . . +WORKDIR "/src/KernelMemory.FileWatcher" +RUN dotnet build "./KernelMemory.FileWatcher.csproj" -c $BUILD_CONFIGURATION -o /app/build +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./KernelMemory.FileWatcher.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false FROM base AS final WORKDIR /app -COPY /app/publish . +COPY --from=publish /app/publish . ENTRYPOINT ["dotnet", "KernelMemory.FileWatcher.dll"] \ No newline at end of file diff --git a/KernelMemory.FileWatcher.sln b/KernelMemory.FileWatcher.sln index e0ec384..2025b32 100644 --- a/KernelMemory.FileWatcher.sln +++ b/KernelMemory.FileWatcher.sln @@ -11,6 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution", "Solution", "{83 .gitattributes = .gitattributes .gitignore = .gitignore G:\docker\km-filewatcher\appsettings.json = G:\docker\km-filewatcher\appsettings.json + Dockerfile = Dockerfile LICENSE.txt = LICENSE.txt README.md = README.md EndProjectSection diff --git a/KernelMemory.FileWatcher/KernelMemory.FileWatcher.csproj b/KernelMemory.FileWatcher/KernelMemory.FileWatcher.csproj index 174a63e..99142f9 100644 --- a/KernelMemory.FileWatcher/KernelMemory.FileWatcher.csproj +++ b/KernelMemory.FileWatcher/KernelMemory.FileWatcher.csproj @@ -5,7 +5,7 @@ enable enable Linux - -v G:\docker\km-filewatcher\appsettings.json:/config/appsettings.json:rw -v E:\Resilio\Obsidian\PersonalVault\talks:/data/notes-talks:ro + -v G:\docker\km-filewatcher\appsettings.json:/config/appsettings.json:rw -v G:\tmp\km-filewatcher\folder_02:/data/folder_02:ro km-filewatcher diff --git a/KernelMemory.FileWatcher/appsettings.json b/KernelMemory.FileWatcher/appsettings.json index e8a2012..5ec6f92 100644 --- a/KernelMemory.FileWatcher/appsettings.json +++ b/KernelMemory.FileWatcher/appsettings.json @@ -8,18 +8,19 @@ }, "FileWatcher": { "Directories": [ - { - "Path": "G:\\tmp\\km-filewatcher\\folder_01", - "Filter": "*.md", - "Index": "folder-01", - "IncludeSubdirectories": true - }, + //{ + // "Path": "G:\\tmp\\km-filewatcher\\folder_01", + // "Filter": "*.md", + // "Index": "folder-01", + // "IncludeSubdirectories": true, + // "InitialScan": true + //}, { "Path": "G:\\tmp\\km-filewatcher\\folder_02", "Filter": "*.md", "Index": "folder-02", "IncludeSubdirectories": true, - "InitialScan": false + "InitialScan": true } ] },