Skip to content

Commit 0121839

Browse files
authored
Update devcontainer.json
1 parent 892613b commit 0121839

1 file changed

Lines changed: 28 additions & 62 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 28 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,30 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2-
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
3-
// https://containers.dev/implementors/json_reference/
4-
// https://code.visualstudio.com/docs/getstarted/settings#_default-settings
5-
// https://github.blog/changelog/2022-10-26-codespaces-customizable-initial-experience/
6-
// https://blog.siliconvalve.com/posts/2023/08/08/using-dev-containers-to-build-a-transportable-blog-writing-environment
7-
// https://stackoverflow.com/questions/72194332/need-a-better-way-to-programmatically-clear-and-set-user-settings-in-vscode
8-
// https://code.visualstudio.com/remote/advancedcontainers/start-processes
9-
// https://github.com/orgs/community/discussions/9644#discussioncomment-2702122 | setting custom start-up message
10-
// https://github.com/orgs/community/discussions/43534 | custom start-up message
11-
// https://github.com/orgs/community/discussions/4068 | default public ports
12-
// ~/.vscode-remote/data/Machine/settings.json
13-
141
{
15-
16-
"name": "Node & Conda",
17-
"image": "mcr.microsoft.com/vscode/devcontainers/miniconda",
18-
19-
// Features to add to the dev container. More info: https://containers.dev/features.
20-
"features": {
21-
//"ghcr.io/devcontainers/features/conda:1": {
22-
// "version": "latest",
23-
// "addCondaForge": "true"
24-
//}
25-
//"ghcr.io/devcontainers-contrib/features/node-asdf:0": {
26-
// "version": "latest"
27-
//}
28-
"ghcr.io/devcontainers/features/node:1": {
29-
"version": "lts"
30-
}
31-
//"ghcr.io/devcontainers-contrib/features/npm-package:1": {
32-
// "package": "@observablehq/framework",
33-
// "version": "latest"
34-
//}
35-
36-
},
37-
38-
"portsAttributes": {
39-
"3000": {
40-
"label": "Live preview",
41-
"onAutoForward": "openPreview"
42-
}
43-
},
44-
45-
"forwardPorts": [3000],
46-
47-
"onCreateCommand": "sudo cp .devcontainer/welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt && npm install",
48-
"waitFor": "onCreateCommand",
49-
"updateContentCommand": "npm install --prefix penguin-classification; \\\nconda config --add channels conda-forge; \\\nconda install --file penguin-classification/requirements.txt --y",
50-
// "postCreateCommand": "conda config --add channels conda-forge; \\\nconda install --file penguin-classification/requirements.txt --y",
51-
"postAttachCommand": {
52-
"server": "code penguin-classification/docs/data/predictions.csv.py && npm run obs"
53-
},
54-
55-
"customizations": {
56-
"codespaces": {
57-
"openFiles": ["penguin-classification/docs/index.md"]
58-
}
59-
}
60-
61-
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
62-
// "remoteUser": "root"
63-
2+
"name": "Observable Framework Python starter",
3+
"image": "mambaorg/micromamba:alpine3.19",
4+
"features": {
5+
"ghcr.io/cirolosapio/devcontainers-features/alpine-node:0": {},
6+
"ghcr.io/devcontainers-contrib/features/bash-command:1": {
7+
"command": "apk update && apk add coreutils wget shadow sudo git; sudo chsh -s /bin/bash ; sudo chsh -s /bin/bash mambauser"
8+
}
9+
},
10+
"remoteEnv": {
11+
"target_repo": "https://github.com/dleeftink/observable-python-codespace.git",
12+
"source_file": "https://raw.githubusercontent.com/dleeftink/observable-python-codespace/main/.devcontainer/setup.sh",
13+
"$MAMBA_ROOT_PREFIX": "/opt/conda"
14+
},
15+
"forwardPorts": [
16+
3000
17+
],
18+
"portsAttributes": {
19+
"3000": {
20+
"label": "Live preview",
21+
"onAutoForward": "openPreview"
22+
}
23+
},
24+
"onCreateCommand": "echo 'Please wait for live pane ...'",
25+
"updateContentCommand": "wget -P .devcontainer \"$source_file\" -nc && chmod +x .devcontainer/*.sh",
26+
"postCreateCommand": ".devcontainer/setup.sh",
27+
"postAttachCommand": {
28+
"init": "code -r -g penguin-classification/docs/data/predictions.csv.py:1; npm run dep && npm run dev"
29+
}
6430
}

0 commit comments

Comments
 (0)