diff --git a/.devcontainer.json b/.devcontainer.json index 951b7b4bc..d939b02ec 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -19,5 +19,6 @@ "EditorConfig.EditorConfig", "paulvarache.vscode-taskfile", "stardog-union.vscode-stardog-languages" - ] + ], + "postCreateCommand": "poetry install --all-extras" } diff --git a/docker-compose.yml b/docker-compose.yml index 3e6377b72..8674b5890 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,17 +10,27 @@ services: - POETRY_VIRTUALENVS_IN_PROJECT=1 volumes: - .:/srv/workspace:z,cached - - xdg-cache-home:/root/.cache - - dot-venv:/srv/workspace/.venv - - dot-tox:/srv/workspace/.tox - - dot-mypy-cache:/srv/workspace/.mypy_cache - - dot-pytest-cache:/srv/workspace/.pytest_cache command: - /bin/sh - -c - | echo Waiting for shutdown... override the command if this is not what you want. 1>&2 while sleep 1000; do :; done + + run: + build: + context: . + dockerfile: Dockerfile.devcontainer + working_dir: /srv/workspace + environment: + - POETRY_VIRTUALENVS_IN_PROJECT=1 + volumes: + - .:/srv/workspace:z,cached + - xdg-cache-home:/root/.cache + - dot-venv:/srv/workspace/.venv + - dot-tox:/srv/workspace/.tox + - dot-mypy-cache:/srv/workspace/.mypy_cache + - dot-pytest-cache:/srv/workspace/.pytest_cache volumes: xdg-cache-home: {} dot-venv: {} diff --git a/docs/developers.rst b/docs/developers.rst index befb84644..89fedb339 100644 --- a/docs/developers.rst +++ b/docs/developers.rst @@ -297,16 +297,16 @@ To use the development container directly: docker-compose build # Configure the system for development. - docker-compose run --rm devcontainer task configure + docker-compose run --rm run task configure # Run the validate task inside the devtools container. - docker-compose run --rm devcontainer task validate + docker-compose run --rm run task validate # Run extensive tests inside the devtools container. - docker-compose run --rm devcontainer task EXTENSIVE=true test + docker-compose run --rm run task EXTENSIVE=true test # To get a shell into the devcontainer docker image. - docker-compose run --rm devcontainer bash + docker-compose run --rm run bash The devcontainer also works with `Podman Compose `_.