This commit is contained in:
@@ -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"]
|
||||||
|
|||||||
@@ -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))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user