I have a simple ASP.NET Core application and it access files from another project. Here are my code:
var currentDirectory = Directory.GetCurrentDirectory();
string directory = Path.GetFullPath(Path.Combine(currentDirectory, @"..\Data\SqlScripts"));
string[] fileArray = Directory.GetFiles(directory, "*.sql");
eturn fileArray.SingleOrDefault(f => f.Contains(filename));
If I run the application in Docker for Linux I get an exceptions saying the files are not found. When I debug the currentDirectory is set to /app instead of the actually physical directory.
How can I get the files also while running in Docker?