Merge pull request #32478 from drodil/devcontainer_contribfest
chore: update devcontainer
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
FROM mcr.microsoft.com/devcontainers/typescript-node:20
|
||||
FROM mcr.microsoft.com/devcontainers/typescript-node:24
|
||||
|
||||
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get -y install chromium \
|
||||
@@ -0,0 +1 @@
|
||||
NODE_OPTIONS=--no-node-snapshot
|
||||
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"name": "Backstage",
|
||||
"forwardPorts": [3000, 7007],
|
||||
"build": { "dockerfile": "Dockerfile" },
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/common-utils:2.5.5": {},
|
||||
"ghcr.io/devcontainers-contrib/features/mkdocs:2": {}
|
||||
},
|
||||
"postCreateCommand": "bash .devcontainer/setup.sh",
|
||||
"hostRequirements": {
|
||||
"cpus": 2,
|
||||
"memory": "4gb",
|
||||
"storage": "32gb"
|
||||
},
|
||||
"runArgs": [
|
||||
"--env-file",
|
||||
".devcontainer/devcontainer.env",
|
||||
"--sysctl",
|
||||
"net.ipv6.conf.all.disable_ipv6=1"
|
||||
],
|
||||
"portsAttributes": {
|
||||
"3000": {
|
||||
"label": "Frontend port",
|
||||
"onAutoForward": "silent",
|
||||
"requireLocalPort": true
|
||||
},
|
||||
"7007": {
|
||||
"label": "Backend port",
|
||||
"onAutoForward": "silent",
|
||||
"requireLocalPort": true
|
||||
},
|
||||
"9464": {
|
||||
"onAutoForward": "silent"
|
||||
}
|
||||
},
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"esbenp.prettier-vscode",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"Intility.vscode-backstage"
|
||||
],
|
||||
"settings": {
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact"
|
||||
],
|
||||
"files.eol": "\n",
|
||||
"prettier.endOfLine": "lf",
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": "explicit",
|
||||
"source.sortMembers": "explicit"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Executable
+28
@@ -0,0 +1,28 @@
|
||||
#!/bin/bash
|
||||
echo "Installing Backstage dependencies..."
|
||||
|
||||
yarn install
|
||||
export VIRTUAL_ENV=$HOME/venv
|
||||
python3 -m venv $VIRTUAL_ENV
|
||||
export PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||
python3 -m pip install mkdocs-techdocs-core
|
||||
|
||||
echo ""
|
||||
echo "╔════════════════════════════════════════════════════════╗ "
|
||||
echo "║ 🚀 Setup Complete! Ready to launch Backstage! ║ "
|
||||
echo "╠════════════════════════════════════════════════════════╣ "
|
||||
echo "║ ║ "
|
||||
echo "║ Open a new terminal and run: ║ "
|
||||
echo "║ ║ "
|
||||
echo "║ yarn start ║ "
|
||||
echo "║ ║ "
|
||||
echo "║ Then access Backstage at: ║ "
|
||||
echo "║ ║ "
|
||||
echo "║ http://localhost:3000 ║ "
|
||||
echo "║ ║ "
|
||||
echo "║ You might need to refresh the page once backend ║ "
|
||||
echo "║ is ready. ║ "
|
||||
echo "║ ║ "
|
||||
echo "║ Happy coding! 🎉 ║ "
|
||||
echo "╚════════════════════════════════════════════════════════╝ "
|
||||
echo ""
|
||||
@@ -1,19 +0,0 @@
|
||||
# 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
|
||||
@@ -1,27 +0,0 @@
|
||||
// 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:2": {}
|
||||
},
|
||||
|
||||
// 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"
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/bin/bash
|
||||
yarn install
|
||||
export VIRTUAL_ENV=$HOME/venv
|
||||
python3 -m venv $VIRTUAL_ENV
|
||||
export PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||
python3 -m pip install mkdocs-techdocs-core
|
||||
@@ -134,6 +134,7 @@
|
||||
"@backstage/eslint-plugin": "workspace:*",
|
||||
"@backstage/repo-tools": "workspace:*",
|
||||
"@changesets/cli": "^2.14.0",
|
||||
"@devcontainers/cli": "^0.81.1",
|
||||
"@jest/environment-jsdom-abstract": "^30",
|
||||
"@octokit/rest": "^19.0.3",
|
||||
"@playwright/test": "^1.32.3",
|
||||
|
||||
@@ -8580,6 +8580,15 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@devcontainers/cli@npm:^0.81.1":
|
||||
version: 0.81.1
|
||||
resolution: "@devcontainers/cli@npm:0.81.1"
|
||||
bin:
|
||||
devcontainer: devcontainer.js
|
||||
checksum: 10/269c88697af36823d6d5d128dd8c08f28714ffd7050d76965da90907bbf579411162a2d499cf3d7ff2d37f442b5419db58d936e5a828b812d4b3d555c923a578
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@elastic/elasticsearch-mock@npm:^1.0.0":
|
||||
version: 1.0.0
|
||||
resolution: "@elastic/elasticsearch-mock@npm:1.0.0"
|
||||
@@ -45527,6 +45536,7 @@ __metadata:
|
||||
"@backstage/eslint-plugin": "workspace:*"
|
||||
"@backstage/repo-tools": "workspace:*"
|
||||
"@changesets/cli": "npm:^2.14.0"
|
||||
"@devcontainers/cli": "npm:^0.81.1"
|
||||
"@jest/environment-jsdom-abstract": "npm:^30"
|
||||
"@manypkg/get-packages": "npm:^1.1.3"
|
||||
"@octokit/rest": "npm:^19.0.3"
|
||||
|
||||
Reference in New Issue
Block a user