Skip to content

Commit c09261e

Browse files
authored
Merge pull request laradock#2319 from lbssousa/devcontainer
Add sample configuration for Visual Studio Code Remote Development
2 parents b34b052 + b7b4687 commit c09261e

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "Laradock",
3+
"dockerComposeFile": ["../docker-compose.yml"],
4+
"runServices": ["nginx", "postgres", "pgadmin"],
5+
"service": "workspace",
6+
"workspaceFolder": "/var/www",
7+
"shutdownAction": "stopCompose",
8+
"postCreateCommand": "uname -a"
9+
}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@
1313
/nginx/ssl/*.key
1414
/nginx/ssl/*.csr
1515

16-
.DS_Store
16+
/.devcontainer/*
17+
!/.devcontainer/devcontainer.example.json
18+
19+
.DS_Store

DOCUMENTATION/content/guides/index.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,16 @@ If you want to only execute some command and don't want to enter bash, you can e
7070
docker-compose run workspace php artisan migrate
7171
```
7272

73+
### Prepare for Visual Studio Code remote development
74+
75+
If you want to use Visual Studio Code for [remote development](https://code.visualstudio.com/docs/remote/containers) directly on your `workspace` container, copy file `devcontainer.example.json` to `devcontainer.json` and customize it (see [devcontainer.json reference](https://code.visualstudio.com/docs/remote/containers#_devcontainerjson-reference) for more options):
76+
```
77+
cd .devcontainer
78+
cp devcontainer.example.json devcontainer.json
79+
```
80+
81+
Then open your `laradock` folder in Visual Studio Code and click on popup button **Reopen in Container**.
82+
7383
### Install and configure Laravel
7484

7585
Let's install Laravel's dependencies, add the `.env` file, generate the key and give proper permissions to the cache folder.

0 commit comments

Comments
 (0)