From d73ff674a129c911bb7efe8e93f33c808feac12b Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Sun, 5 May 2024 02:30:10 +0000 Subject: [PATCH] feat: :technologist: Add Devcontainers support --- .devcontainer/Dockerfile | 10 ++++++++++ .devcontainer/devcontainer.json | 34 +++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..5be8e353 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,10 @@ +# Bun doesn't run well on Musl but this seems to work +FROM oven/bun:1.1.7-alpine as base + +RUN apk add --no-cache libstdc++ git bash curl openssh + +# Switch to Bash by editing /etc/passwd +RUN sed -i -e 's|/bin/ash|/bin/bash|g' /etc/passwd + +# Extract Node from its docker image (node:22-alpine) +COPY --from=node:22-alpine /usr/local/bin/node /usr/local/bin/node \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..7c002c27 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,34 @@ +{ + "name": "Lysand Dev Container", + "dockerFile": "Dockerfile", + "runArgs": [ + "-v", + "${localWorkspaceFolder}/config:/workspace/config", + "-v", + "${localWorkspaceFolder}/logs:/workspace/logs", + "-v", + "${localWorkspaceFolder}/uploads:/workspace/uploads", + "--network=host" + ], + "mounts": [ + "source=node_modules,target=/workspace/node_modules,type=bind,consistency=cached", + "type=bind,source=/home/${localEnv:USER}/.ssh,target=/root/.ssh,readonly" + ], + "customizations": { + "vscode": { + "settings": { + "terminal.integrated.shell.linux": "/bin/bash" + }, + "extensions": [ + "biomejs.biome", + "ms-vscode-remote.remote-containers", + "oven.bun-vscode", + "vivaxy.vscode-conventional-commits", + "EditorConfig.EditorConfig", + "tamasfe.even-better-toml", + "YoavBls.pretty-ts-errors", + "ms-vscode-remote.remote-containers" + ] + } + } +}