Clean Cock
Clean Cock
CC#
Created by Clean Cock on 4/19/2025 in #help
No permission for file saving when hosting .net apps on docker.
im going to sleep now, sorry, ill respond how it went tommorow
32 replies
CC#
Created by Clean Cock on 4/19/2025 in #help
No permission for file saving when hosting .net apps on docker.
FROM base AS final
USER $APP_UID
VOLUME /app/images
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "PlantApi.dll"]
FROM base AS final
USER $APP_UID
VOLUME /app/images
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "PlantApi.dll"]
32 replies
CC#
Created by Clean Cock on 4/19/2025 in #help
No permission for file saving when hosting .net apps on docker.
System.UnauthorizedAccessException: Access to the path '/app/images/bsrzh25a.jpg' is denied.
System.UnauthorizedAccessException: Access to the path '/app/images/bsrzh25a.jpg' is denied.
32 replies
CC#
Created by Clean Cock on 4/19/2025 in #help
No permission for file saving when hosting .net apps on docker.
uhm which user bit?
32 replies
CC#
Created by Clean Cock on 4/19/2025 in #help
No permission for file saving when hosting .net apps on docker.
first time hearing about that, gotta read about it
32 replies
CC#
Created by Clean Cock on 4/19/2025 in #help
No permission for file saving when hosting .net apps on docker.
volumes:
- images:/app/images
volumes:
- images:/app/images
my docker-compose.yml does the job
32 replies
CC#
Created by Clean Cock on 4/19/2025 in #help
No permission for file saving when hosting .net apps on docker.
No description
32 replies
CC#
Created by Clean Cock on 4/19/2025 in #help
No permission for file saving when hosting .net apps on docker.
/app seems to be in the main(?), root(?) directory, you cannot go outiside
32 replies
CC#
Created by Clean Cock on 4/19/2025 in #help
No permission for file saving when hosting .net apps on docker.
it's after some experimenting, i tried many commands
32 replies
CC#
Created by Clean Cock on 4/19/2025 in #help
No permission for file saving when hosting .net apps on docker.
No description
32 replies
CC#
Created by Clean Cock on 4/19/2025 in #help
No permission for file saving when hosting .net apps on docker.
# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.

# This stage is used when running from VS in fast mode (Default for Debug configuration)
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081


# This stage is used to build the service project
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["Atlas_Pylkow/Atlas_Pylkow.csproj", "Atlas_Pylkow/"]
RUN dotnet restore "./Atlas_Pylkow/Atlas_Pylkow.csproj"
COPY . .
WORKDIR "/src/Atlas_Pylkow"
RUN dotnet build "./Atlas_Pylkow.csproj" -c $BUILD_CONFIGURATION -o /app/build

# This stage is used to publish the service project to be copied to the final stage
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./Atlas_Pylkow.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration)
FROM base AS final
WORKDIR /app
RUN chmod chmod -R a+rw /app/images
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Atlas_Pylkow.dll"]
# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.

# This stage is used when running from VS in fast mode (Default for Debug configuration)
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081


# This stage is used to build the service project
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["Atlas_Pylkow/Atlas_Pylkow.csproj", "Atlas_Pylkow/"]
RUN dotnet restore "./Atlas_Pylkow/Atlas_Pylkow.csproj"
COPY . .
WORKDIR "/src/Atlas_Pylkow"
RUN dotnet build "./Atlas_Pylkow.csproj" -c $BUILD_CONFIGURATION -o /app/build

# This stage is used to publish the service project to be copied to the final stage
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./Atlas_Pylkow.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration)
FROM base AS final
WORKDIR /app
RUN chmod chmod -R a+rw /app/images
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Atlas_Pylkow.dll"]
32 replies
CC#
Created by Clean Cock on 4/19/2025 in #help
No permission for file saving when hosting .net apps on docker.
I tried to change ownership and permissions by using RUN command in dockerfile, owner is still root for some reason
32 replies
CC#
Created by Clean Cock on 4/7/2025 in #help
✅ EF Core migrations with Docker
yea this makes life easier, ill read about that and implement it later, thanks
22 replies
CC#
Created by Clean Cock on 4/7/2025 in #help
✅ EF Core migrations with Docker
oh, so for development applying them on startup would be the best option
22 replies
CC#
Created by Clean Cock on 4/7/2025 in #help
✅ EF Core migrations with Docker
if I do not change anything in schema and set migrations on startup will it create empty migrations?
22 replies
CC#
Created by Clean Cock on 4/7/2025 in #help
✅ EF Core migrations with Docker
im just starting to develop this app so for now it would be every time I add a new model or something
22 replies
CC#
Created by Clean Cock on 4/7/2025 in #help
✅ EF Core migrations with Docker
yes
22 replies
CC#
Created by Clean Cock on 4/7/2025 in #help
✅ EF Core migrations with Docker
im fairly new to both docker and ef core and I mostly have no idea what are you talking about sorry, ill try to do a better research first
22 replies
CC#
Created by Clean Cock on 4/7/2025 in #help
✅ EF Core migrations with Docker
Yea, the catch is that im running both database and blazor app via docker compose on separate containers
22 replies
MModular
Created by bunny on 5/14/2024 in #community-showcase
toybox
also shold I spam this channel?
13 replies