I am running a Vue & Laravel project on docker.
Project structure and everything about the setup
To start with, I am currently trying to upload images on server.
If I would run this project without docker, it will work as planned (files are being uploaded on server and they are accessible).
However, if I would run this project with docker, it will throw an error (can't find directory).
Important remark: I have a guess that it might be happening because I am working with files on the backend (laravel controller, code is down below). So it can access only backend volume.
It is trying to locate a file at the frontend volume, but it can't access it.
So, here is the question: how to access that volume?
File controller:
public function uploadFile (Request $request) {
# Processing to base64
$exploded = explode(',', $request->image_data);
$decoded = base64_decode($exploded[1]);
# Configuring the extension
$extension = strtok(explode('/', $exploded[0])[1], ';');
# Defining the path
$path = '../../'.'frontend'.'/'.'src'.'/'.'assets'.'/'.'img'.'/'.'files'.'/'.$request->file_name;
# Uploading file to the storage
file_put_contents($path, $decoded);
}