diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 000000000..9f20426fc --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,6 @@ +ARG VARIANT="16-buster" +FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:${VARIANT} + +RUN npm install -g pnpm + +ENV PATH="${PATH}:./node_modules/.bin" diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..e547dd7ed --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,27 @@ +{ + "name": "homepage", + "build": { + "dockerfile": "Dockerfile", + "args": { + "VARIANT": "18-buster" + } + }, + "customizations": { + "vscode": { + "extensions": [ + "dbaeumer.vscode-eslint", + "mhutchie.git-graph", + "streetsidesoftware.code-spell-checker", + ], + "settings": { + "eslint.format.enable": true, + "eslint.lintTask.enable": true, + "eslint.packageManager": "pnpm" + } + } + }, + "postCreateCommand": ".devcontainer/setup.sh", + "forwardPorts": [ + 3000 + ] +} diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh new file mode 100755 index 000000000..70bf96cfd --- /dev/null +++ b/.devcontainer/setup.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# Install Node packages +pnpm install + +# Copy in skeleton configuration if there is no existing configuration +if [ ! -d "config/" ]; then + echo "Adding skeleton config" + mkdir config/ + cp -r src/skeleton/* config +fi