diff --git a/contrib/.devcontainer/Dockerfile b/contrib/.devcontainer/Dockerfile new file mode 100644 index 0000000000..35459b8d97 --- /dev/null +++ b/contrib/.devcontainer/Dockerfile @@ -0,0 +1,5 @@ +FROM mcr.microsoft.com/devcontainers/typescript-node:18 + +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -y install chromium \ + && apt-get -y install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev diff --git a/contrib/.devcontainer/README.md b/contrib/.devcontainer/README.md new file mode 100644 index 0000000000..4fca39b3ad --- /dev/null +++ b/contrib/.devcontainer/README.md @@ -0,0 +1,19 @@ +# Devcontainer Configuration + +[Devcontainer](https://code.visualstudio.com/docs/devcontainers/containers) is a VSCode feature that allows developers +to share a common workspace definition, by leveraging Docker to run the workspace, and using VSCode Remote Development extension, you can make sure the developer experience is the same across different computers + +## Benefits + +- Developers only need to have VSCode and Docker installed +- All dependencies necessary to work in the repository are contained in the docker image +- Makes it easier for new developers to start contributing to the project +- No extra setup required + +## Known Issues + +- Performance is a known issue. Working inside devcontainers require developers to have a powerful computer. See [System Requirements](https://code.visualstudio.com/docs/devcontainers/containers#_system-requirements) + +## Usage + +Just copy the .devcontainer folder to the root of the directory, and VSCode will automatically detect the configuration and suggest that you re-open the repository using Devcontainer diff --git a/contrib/.devcontainer/devcontainer.json b/contrib/.devcontainer/devcontainer.json new file mode 100644 index 0000000000..b312102784 --- /dev/null +++ b/contrib/.devcontainer/devcontainer.json @@ -0,0 +1,27 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node +{ + "name": "Base Backstage Workspace", + "build": { "dockerfile": "Dockerfile" }, + "features": { + "ghcr.io/devcontainers/features/common-utils:1": {}, + "ghcr.io/devcontainers/features/docker-from-docker:1": {}, + "ghcr.io/devcontainers-contrib/features/mkdocs:1": {} + }, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [3000, 7007], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "bash .devcontainer/postCreate.sh", + + // Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": ["Intility.vscode-backstage"] + } + } + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/contrib/.devcontainer/postCreate.sh b/contrib/.devcontainer/postCreate.sh new file mode 100755 index 0000000000..f0631a4af2 --- /dev/null +++ b/contrib/.devcontainer/postCreate.sh @@ -0,0 +1,3 @@ +#!/bin/bash +yarn install +pip install mkdocs-techdocs-core \ No newline at end of file