From d874feb60b1aa70ac835df0a1d2feb0629af2c29 Mon Sep 17 00:00:00 2001 From: David Regla Date: Tue, 14 May 2024 21:06:22 -0600 Subject: [PATCH] Update/simplify some Docker Compose configuration examples --- .../connect-multiple-containers.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/remote/advancedcontainers/connect-multiple-containers.md b/remote/advancedcontainers/connect-multiple-containers.md index 0c630fcec2..05e75ae8e0 100644 --- a/remote/advancedcontainers/connect-multiple-containers.md +++ b/remote/advancedcontainers/connect-multiple-containers.md @@ -35,23 +35,20 @@ The location of the `.git` folder is important, since we will need to ensure the Next, assume the `docker-compose.yml` in the root is as follows: ```yaml -version: '3' services: python-api: image: mcr.microsoft.com/devcontainers/python:1-3.12-bookworm volumes: # Mount the root folder that contains .git - - .:/workspace:cached + - .:/workspace command: sleep infinity - links: - - node-app # ... node-app: image: mcr.microsoft.com/devcontainers/typescript-node:1-20-bookworm volumes: # Mount the root folder that contains .git - - .:/workspace:cached + - .:/workspace command: sleep infinity # ... ``` @@ -80,7 +77,7 @@ Next, you can set up `./devcontainer/node-container/devcontainer.json` for Node. } ``` -The `"shutdownAction":"none"` in the `devcontainer.json` files is optional, but will leave the containers running when VS Code closes -- which prevents you from accidentally shutting down both containers by closing one window. +The `"shutdownAction": "none"` in the `devcontainer.json` files is optional, but will leave the containers running when VS Code closes -- which prevents you from accidentally shutting down both containers by closing one window. ## Connect to multiple containers in multiple VS Code windows @@ -110,16 +107,15 @@ If you want to [extend your Docker Compose file for development](/docs/devcontai For example, consider this `docker-compose.devcontainer.yml` file: ```yaml -version: '3' services: python-api: volumes: - - ~:~/local-home-folder:cached # Additional bind mount + - ~:~/local-home-folder # Additional bind mount # ... node-app: volumes: - - ~/some-folder:~/some-folder:cached # Additional bind mount + - ~/some-folder:~/some-folder # Additional bind mount # ... ```