How to configure the terminal to open in the current directory inside the docker container?

I use Laradock, and whenever I open a project I need to do the following:

Open the terminal and use an alias (ld-bash => docker-compose exec workspace bash) that I created in Linux to enter the terminal inside the container (laradock_workspace_1) and access the current project directory with the cd [directory] command.

Alternatively, open the Services tab, select Docker, Docker-Compose: laradock, select workspace, select laradock_workspace_1, open a terminal and enter the project directory using the cd [directory] command.

Is there any way to simplify this process, so that I can just open the terminal (which already opens in the current directory) and execute commands inside the container?

Example: I create a Laravel project and I can run "php artisan" just by opening the terminal, without having to open a terminal inside the container, enter the correct directory and only then run "php artisan".

0

Not sure if you have tried it already but just a quick idea – you may try using PHP Command Line Tools feature as it supports Laravel (artisan) and remote CLI Interpreters:

https://www.jetbrains.com/help/phpstorm/2023.2/command-line-tool-support.html

0

请先登录再写评论。