Commit 69e72667 authored by Yassine Doghri's avatar Yassine Doghri
Browse files

feat(devcontainer): add devcontainer settings for dev environment

parent d5235975
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
FROM php:latest

RUN apt-get update && apt-get install -y \
    libicu-dev \
    && docker-php-ext-install intl

COPY --from=composer /usr/bin/composer /usr/bin/composer

RUN apt-get update && \
    apt-get upgrade -y && \
    apt-get install -y git
+16 −0
Original line number Diff line number Diff line
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.117.1/containers/docker-existing-dockerfile
{
	"name": "Existing Dockerfile",
	"dockerFile": "./Dockerfile",
	"settings": {
		"terminal.integrated.shell.linux": null
	},
	"extensions": [
		"mikestead.dotenv",
		"bmewburn.vscode-intelephense-client",
		"streetsidesoftware.code-spell-checker",
		"naumovs.color-highlight",
		"heybourn.headwind"
	]
}
 No newline at end of file
+21 −0
Original line number Diff line number Diff line
@@ -128,3 +128,24 @@ docker-compose down
```

Check [docker](https://docs.docker.com/engine/reference/commandline/docker/) and [docker-compose](https://docs.docker.com/compose/reference/) documentations for more insights.

### Developing inside a Container

If you're working in VSCode, you can take advantage of the `./.devcontainer/` folder. It defines a development container with preinstalled VSCode extensions so you don't have to worry about them. The container will be loaded with php, composer and git:

1. Install the VSCode extension [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
2. `Ctrl/Cmd + Shift + P` > `Open in container`

The VSCode window will reload inside the dev container.

You can check that the required packages are running in the console (`Terminal` > `New Terminal`):

```bash
php -v

composer -V

git version
```

For more info, see [VSCode Remote Containers](https://code.visualstudio.com/docs/remote/containers)