|
1 | | -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: |
2 | | -// https://github.com/microsoft/vscode-dev-containers/tree/v0.192.0/containers/docker-in-docker |
| 1 | +// For format details, https://containers.dev/implementors/json_reference/. |
3 | 2 | { |
4 | | - "name": "Docker in Docker", |
5 | | - "dockerFile": "Dockerfile", |
6 | | - "runArgs": ["--init", "--privileged"], |
7 | | - "mounts": ["source=dind-var-lib-docker,target=/var/lib/docker,type=volume"], |
8 | | - "overrideCommand": false, |
| 3 | + "name": "WordPress Development Environment", |
| 4 | + "dockerComposeFile": "../docker-compose.yml", |
| 5 | + "service": "app", |
| 6 | + "mounts": ["source=dind-var-lib-docker,target=/var/lib/docker,type=volume"], |
| 7 | + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", |
9 | 8 |
|
10 | | - // Set *default* container specific settings.json values on container create. |
11 | | - "settings": {}, |
| 9 | + "customizations": { |
| 10 | + "vscode": { |
| 11 | + // Set *default* container specific settings.json values on container create. |
| 12 | + "settings": {}, |
12 | 13 |
|
13 | | - // Add the IDs of extensions you want installed when the container is created. |
14 | | - "extensions": [ |
15 | | - "ms-azuretools.vscode-docker" |
16 | | - ], |
| 14 | + // Add the IDs of extensions you want installed when the container is created. |
| 15 | + "extensions": ["ms-azuretools.vscode-docker"] |
| 16 | + } |
| 17 | + }, |
17 | 18 |
|
18 | | - // Use 'forwardPorts' to make a list of ports inside the container available locally. |
19 | | - // "forwardPorts": [], |
| 19 | + // Features to add to the dev container. More info: https://containers.dev/features. |
| 20 | + "features": { |
| 21 | + "./local-features/welcome-message": "latest" |
| 22 | + }, |
20 | 23 |
|
21 | | - // Use 'postCreateCommand' to run commands after the container is created. |
22 | | - "postCreateCommand": "npm run setup", |
| 24 | + // Use 'forwardPorts' to make a list of ports inside the container available locally. |
| 25 | + "forwardPorts": [8080, 8081, 8026, 3306], |
23 | 26 |
|
24 | | - // Use 'postStartCommand' to run commands after the container has started. |
25 | | - "postStartCommand": "npm start -- --update", |
| 27 | + // Maps a port number, "host:port" value, range, or regular expression to a set of default options. See port attributes for available options |
| 28 | + "portsAttributes": { |
| 29 | + "8080": { |
| 30 | + "label": "WordPress Development/Testing Site" |
| 31 | + }, |
| 32 | + "8081": { |
| 33 | + "label": "phpMyAdmin" |
| 34 | + }, |
| 35 | + "8026": { |
| 36 | + "label": "MailHog" |
| 37 | + }, |
| 38 | + "3306": { |
| 39 | + "label": "MariaDB" |
| 40 | + } |
| 41 | + }, |
26 | 42 |
|
27 | | - // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. |
28 | | - "remoteUser": "vscode" |
| 43 | + // Use `onCreateCommand` to run commands as part of the container creation. |
| 44 | + //"onCreateCommand": "chmod +x .devcontainer/install.sh && .devcontainer/install.sh", |
| 45 | + |
| 46 | + // Use 'postCreateCommand' to run commands after the container is created. |
| 47 | + "postCreateCommand": "chmod +x .devcontainer/setup.sh && .devcontainer/setup.sh", |
| 48 | + |
| 49 | + // Use 'postStartCommand' to run commands after the container has started. |
| 50 | + "postStartCommand": "chmod +x .devcontainer/activate.sh && .devcontainer/activate.sh", |
| 51 | + |
| 52 | + // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. |
| 53 | + "remoteUser": "wp_php", |
| 54 | + |
| 55 | + // A set of name-value pairs that sets or overrides environment variables for the devcontainer.json supporting service / tool (or sub-processes like terminals) but not the container as a whole. |
| 56 | + "remoteEnv": { "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" } |
29 | 57 | } |
0 commit comments