dotnet / dotnet-docker

Docker images for .NET and the .NET Tools.
https://hub.docker.com/_/microsoft-dotnet
MIT License
4.44k stars 1.93k forks source link

Full access for application #5689

Closed wisamidris7 closed 2 months ago

wisamidris7 commented 2 months ago

I used the dotnet publish command to containerize my ASP.NET Core application. I then integrated this container into a Docker Compose setup by defining it in a YAML file (docker-compose.yml). However, my ASP.NET Core application requires specific access permissions for two folders: Resources for localization and App_Data for saving images.

In my docker-compose.yml, I attempted to configure these permissions as follows:

services:
  application:
    container_name: "application"
    image: "myapp:latest"
    ports:
      - target: 8080
        published: 10000
      - target: 8443
        published: 10001
    access_folders:
      - app/Resources: read-only
      - app/App_Data: full access

I need guidance on properly granting read-only access to the Resources folder and full access to the App_Data folder within Docker Compose.

richlander commented 2 months ago

The simplest path is for these directories to be in the user directory. Is that possible?