aboutsummaryrefslogtreecommitdiffstats
path: root/.devcontainer
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-05-13 17:26:25 +0100
committerMatthew Lemon <y@yulqen.org>2024-05-13 17:26:25 +0100
commitefbbd480ddc62e695123d31c31d233b0df5155bd (patch)
treebc2fb465edd5050d83c97f280b1aac8e023fe3e5 /.devcontainer
After first pre-commit processing
Diffstat (limited to '')
-rw-r--r--.devcontainer/bashrc.override.sh20
-rw-r--r--.devcontainer/devcontainer.json36
2 files changed, 56 insertions, 0 deletions
diff --git a/.devcontainer/bashrc.override.sh b/.devcontainer/bashrc.override.sh
new file mode 100644
index 0000000..bedddf6
--- /dev/null
+++ b/.devcontainer/bashrc.override.sh
@@ -0,0 +1,20 @@
+
+#
+# .bashrc.override.sh
+#
+
+# persistent bash history
+HISTFILE=~/.bash_history
+PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
+
+# set some django env vars
+source /entrypoint
+
+# restore default shell options
+set +o errexit
+set +o pipefail
+set +o nounset
+
+# start ssh-agent
+# https://code.visualstudio.com/docs/remote/troubleshooting
+eval "$(ssh-agent -s)"
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 0000000..b78092f
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,36 @@
+// For format details, see https://containers.dev/implementors/json_reference/
+{
+ "name": "pyblackbird_cc_dev",
+ "dockerComposeFile": [
+ "../local.yml"
+ ],
+ "init": true,
+ "mounts": [
+ {
+ "source": "./.devcontainer/bash_history",
+ "target": "/home/dev-user/.bash_history",
+ "type": "bind"
+ },
+ {
+ "source": "~/.ssh",
+ "target": "/home/dev-user/.ssh",
+ "type": "bind"
+ }
+ ],
+ // Tells devcontainer.json supporting services / tools whether they should run
+ // /bin/sh -c "while sleep 1000; do :; done" when starting the container instead of the container’s default command
+ "overrideCommand": false,
+ "service": "django",
+ // "remoteEnv": {"PATH": "/home/dev-user/.local/bin:${containerEnv:PATH}"},
+ "remoteUser": "dev-user",
+ "workspaceFolder": "/app",
+ // Set *default* container specific settings.json values on container create.
+ "customizations": {
+ },
+ // Uncomment the next line if you want start specific services in your Docker Compose config.
+ // "runServices": [],
+ // Uncomment the next line if you want to keep your containers running after VS Code shuts down.
+ // "shutdownAction": "none",
+ // Uncomment the next line to run commands after the container is created.
+ "postCreateCommand": "cat .devcontainer/bashrc.override.sh >> ~/.bashrc"
+}