From 52fcafe714d923c9b0867f662a0336fd265939b7 Mon Sep 17 00:00:00 2001 From: Adam Matthiesen Date: Sun, 6 Oct 2024 13:58:14 -0700 Subject: [PATCH] Setup Devcontainer config (#343) * Add devcontainer configuration and Dockerfile * update --- .devcontainer/Dockerfile | 7 +++++++ .devcontainer/devcontainer.json | 26 ++++++++++++++++++++++++++ .devcontainer/welcome-message.txt | 3 +++ 3 files changed, 36 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/welcome-message.txt diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000..22c7a3908 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,7 @@ +FROM mcr.microsoft.com/devcontainers/javascript-node:0-20 + +# We uninstall pnpm here, since we enable the corepack version in the postCreateCommand +# This ensures we respect the "packageManager" version in package.json +RUN npm uninstall -g pnpm + +COPY welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..43740c742 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,26 @@ +{ + "name": "StudioCMS Workspace", + "build": { + "dockerfile": "Dockerfile" + }, + + "postCreateCommand": "sudo corepack enable pnpm && pnpm config set store-dir /home/node/.pnpm-store && PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 pnpm install", + + "waitFor": "postCreateCommand", + + "customizations": { + "codespaces": { + "openFiles": ["README.md"] + }, + "vscode": { + "extensions": [ + "astro-build.astro-vscode", + "astro-build.houston", + "biomejs.biome", + "eamodio.gitlens", + "redhat.vscode-yaml", + "ZainChen.json" + ] + } + } +} diff --git a/.devcontainer/welcome-message.txt b/.devcontainer/welcome-message.txt new file mode 100644 index 000000000..433af6070 --- /dev/null +++ b/.devcontainer/welcome-message.txt @@ -0,0 +1,3 @@ +👋 Welcome to StudioCMS! + +🛠️ Your environment is fully setup with all required software installed.