Skip to content

Commit

Permalink
Update devcontainer: use docker-compose.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kzzzr committed Oct 12, 2023
1 parent eb0b234 commit dec17e2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 22 deletions.
31 changes: 19 additions & 12 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand All @@ -23,7 +28,8 @@
"ms-python.python",
"eamodio.gitlens",
"GitHub.vscode-pull-request-github",
"nemesv.copy-file-name"
"nemesv.copy-file-name",
"hashicorp.terraform"
]
}
},
Expand All @@ -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",
Expand Down
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -24,6 +32,6 @@ services:
- 4000:4000
- 15432:15432
env_file:
- .env
- .env
volumes:
- .:/cube/conf

0 comments on commit dec17e2

Please sign in to comment.