Ny folder
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Elias Jansson
2026-01-24 14:59:51 +01:00
parent 55a118f8c9
commit 0cbe46c93a
2 changed files with 2 additions and 13 deletions

View File

@@ -42,18 +42,6 @@ RUN dotnet publish "Aberwyn.csproj" -c Release -o /app/publish --no-restore
# Slutgiltig image baserad på runtime # Slutgiltig image baserad på runtime
FROM base AS final FROM base AS final
WORKDIR /app WORKDIR /app
# Skapa Unraid-kompatibel user om den inte redan finns
RUN getent group users || groupadd -g 100 users \
&& id -u nobody || useradd -u 99 -g 100 nobody
# Skapa data-mapp och sätt rätt ägare
RUN mkdir -p /app/data \
&& chown -R 99:100 /app
COPY --from=publish /app/publish . COPY --from=publish /app/publish .
# Kör som nobody (Unraid-standard)
USER 99:100
ENTRYPOINT ["dotnet", "Aberwyn.dll"] ENTRYPOINT ["dotnet", "Aberwyn.dll"]

View File

@@ -26,7 +26,8 @@ builder.Configuration.AddConfiguration(config);
// Läser setup.json eller skapar en ny tom om den inte finns // Läser setup.json eller skapar en ny tom om den inte finns
var dataRoot = Path.Combine(Directory.GetCurrentDirectory(), "data"); var dataRoot = Path.Combine(Directory.GetCurrentDirectory(), "data");
var setupFilePath = Path.Combine("data", "infrastructure", "setup.json"); var setupFilePath = Path.Combine(dataRoot, "infrastructure", "setup.json");
Directory.CreateDirectory(Path.GetDirectoryName(setupFilePath)!);
if (!File.Exists(setupFilePath)) if (!File.Exists(setupFilePath))
{ {