From dec17e23070aa952ef51079c390f69eb0324f215 Mon Sep 17 00:00:00 2001 From: Artemiy Kozyr Date: Thu, 12 Oct 2023 18:01:19 +0000 Subject: [PATCH] Update devcontainer: use docker-compose.yml --- .devcontainer/devcontainer.json | 31 +++++++++++++++++++------------ README.md | 10 ++-------- docker-compose.yml | 12 ++++++++++-- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b26d167..ca36e77 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,16 +1,21 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile { - "name": "Existing Dockerfile", - "build": { - // Sets the run context to one level up instead of the .devcontainer folder. - // "context": "." - // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. - "dockerfile": "../Dockerfile" - }, + "name": "Existing Docker Compose (Extend)", + + // Update the 'dockerComposeFile' list if you have more compose files or use different names. + // The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. + "dockerComposeFile": [ + "../docker-compose.yml" + ], - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, + // The 'service' property is the name of the service for the container that VS Code should + // use. Update this value and .devcontainer/docker-compose.yml to the real service name. + "service": "devcontainer", + + // The optional 'workspaceFolder' property is the path VS Code should open by default when + // connected. This is typically a file mount in .devcontainer/docker-compose.yml + "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", // Use 'forwardPorts' to make a list of ports inside the container available locally. "forwardPorts": [ @@ -23,7 +28,8 @@ "ms-python.python", "eamodio.gitlens", "GitHub.vscode-pull-request-github", - "nemesv.copy-file-name" + "nemesv.copy-file-name", + "hashicorp.terraform" ] } }, @@ -38,9 +44,10 @@ "userGid": "automatic" }, "ghcr.io/stuartleeks/dev-container-features/shell-history:0": {} - }, + } + + // "runArgs": ["--env-file",".env"] - "runArgs": ["--env-file",".env", "--network=mybi-dbt-showcase_default"] // Uncomment the next line to run commands after the container is created. // "postCreateCommand": "cat /etc/os-release", diff --git a/README.md b/README.md index 8f19f75..3f99340 100644 --- a/README.md +++ b/README.md @@ -37,16 +37,10 @@ This repo guides you through building analyics for [myBI Market](https://market. - Clickhouse - Metabase - Cube + - devcontainer (with dbt installed) ```bash - # launch containers: clickhouse, metabase, cube - docker-compose build --no-cache - docker-compose up -d - ``` - -4. Open dev container with dbt installed - - ```bash + devcontainer build . devcontainer open . # test connections diff --git a/docker-compose.yml b/docker-compose.yml index 4cd4c48..95a20bf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,16 @@ version: '2' services: + devcontainer: + build: . + entrypoint: ["tail", "-f", "/dev/null"] + # env_file: + # - .env + volumes: + - .:/workspaces/mybi_dbt_showcase/ + clickhouse: - image: clickhouse/clickhouse-server:22.3 + image: clickhouse/clickhouse-server:23.3 ports: - 9000:9000 - 8123:8123 @@ -24,6 +32,6 @@ services: - 4000:4000 - 15432:15432 env_file: - - .env + - .env volumes: - .:/cube/conf