generated from dleeftink/observable-node-codespace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevImage.jsonc
72 lines (60 loc) · 2.97 KB
/
devImage.jsonc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
// https://containers.dev/implementors/json_reference/
// https://code.visualstudio.com/docs/getstarted/settings#_default-settings
// https://github.blog/changelog/2022-10-26-codespaces-customizable-initial-experience/
// https://blog.siliconvalve.com/posts/2023/08/08/using-dev-containers-to-build-a-transportable-blog-writing-environment
// https://stackoverflow.com/questions/72194332/need-a-better-way-to-programmatically-clear-and-set-user-settings-in-vscode
// https://code.visualstudio.com/remote/advancedcontainers/start-processes
// https://github.com/orgs/community/discussions/9644#discussioncomment-2702122 | setting custom start-up message
// https://github.com/orgs/community/discussions/43534 | custom start-up message
// https://github.com/orgs/community/discussions/4068 | default public ports
// ~/.vscode-remote/data/Machine/settings.json
// Example build command:
// devcontainer build --workspace-folder . --image-name suptext/observable-python-image:0.1.0
// to do: make setup.sh accept a repo argument and rebuild images
{
"name": "Observable Framework Python starter",
"image": "mambaorg/micromamba:alpine3.19",
"features": {
"ghcr.io/cirolosapio/devcontainers-features/alpine-node:0": {
"globalPackages": "@devcontainers/cli" // remove in prod
},
"ghcr.io/cirolosapio/devcontainers-features/alpine-docker-outside-of-docker:0": {}, // remove in prod
"ghcr.io/devcontainers-contrib/features/bash-command:1": {
"command": "apk update && apk add coreutils wget shadow sudo git; sudo chsh -s /bin/bash ; sudo chsh -s /bin/bash mambauser"
}
},
"remoteUser": "root", // run as root when in dev
"remoteEnv": {
"target_repo": "https://github.com/dleeftink/observable-python-codespace.git",
"source_file": "https://raw.githubusercontent.com/dleeftink/observable-python-codespace/main/.devcontainer/setup.sh",
"$MAMBA_ROOT_PREFIX": "/opt/conda"
},
"forwardPorts": [3000],
"portsAttributes": {
"3000": {
"label": "Live preview",
"onAutoForward": "openPreview"
}
},
"onCreateCommand": "echo 'Please wait for live pane ...'",
"updateContentCommand": "wget -P .devcontainer \"$source_file\" -nc && chmod +x .devcontainer/*.sh",
"postCreateCommand": ".devcontainer/setup.sh",
"postAttachCommand": {
"init": "code -r -g penguin-classification/docs/data/predictions.csv.py:1; npm run dep && npm run dev"
},
"customizations": {
"vscode": {
"extensions": []/*, //["ms-azuretools.vscode-docker"]/*,
"settings": {
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash"
}
}
}*/
}
}
}