From e2b8d02063b30ddf93fcfd6ba2bca632c3636654 Mon Sep 17 00:00:00 2001 From: Amritanshu Date: Sun, 23 Jul 2023 08:12:42 +0530 Subject: [PATCH] VSCode Dev Container --- .devcontainer/Dockerfile | 16 ++++++++++++ .devcontainer/devcontainer.json | 27 +++++++++++++++++++ .vscode/extensions.json | 5 ++++ .vscode/launch.json | 12 ++++----- .vscode/tasks.json | 46 +++++++++++++++++++++++++++++++++ 5 files changed, 99 insertions(+), 7 deletions(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .vscode/extensions.json create mode 100644 .vscode/tasks.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..95f93b00 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,16 @@ +# For more information, please refer to https://aka.ms/vscode-docker-python +FROM mcr.microsoft.com/devcontainers/python:0-3.11 + +RUN apt-get update && \ + apt-get install -y locales && \ + sed --in-place --expression='s/# en_IN UTF-8/en_IN UTF-8/' /etc/locale.gen && \ + dpkg-reconfigure --frontend=noninteractive locales + +ENV LANG en_IN +ENV LC_ALL en_IN + +# Install Poetry +RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python - && \ + cd /usr/local/bin && \ + ln -s /opt/poetry/bin/poetry && \ + poetry config virtualenvs.create false diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..98945afd --- /dev/null +++ b/.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/python +{ + "name": "Python 3", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "build": { "dockerfile": "Dockerfile" }, + "features": { + "ghcr.io/devcontainers/features/node:1": {} + }, + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [5432], + + "runArgs": ["--network=host"], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "poetry config virtualenvs.create false && cd brewman && poetry install --no-root", + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + "remoteUser": "root" +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..8d57033d --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,5 @@ +{ + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 + "recommendations": ["angular.ng-template"] +} + \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 1c18ee56..78b77a89 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,22 +5,20 @@ "version": "0.2.0", "configurations": [ { - "command": "npm start", "name": "ng serve", + "type": "chrome", "request": "launch", - "type": "node-terminal", - "cwd": "${workspaceFolder}/overlord", + "preLaunchTask": "npm: start", + "url": "http://localhost:4200/" }, { "name": "Python: FastAPI", "type": "python", "request": "launch", "module": "brewman", + "args": [], "cwd": "${workspaceFolder}/brewman", - "args": [ - ], - "jinja": true, - "justMyCode": true, + "justMyCode": true } ] } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..97e663d6 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,46 @@ +{ + // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558 + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "start", + "isBackground": true, + "options": { + "cwd": "${workspaceFolder}/overlord" + }, + "problemMatcher": { + "owner": "typescript", + "pattern": "$tsc", + "background": { + "activeOnStart": true, + "beginsPattern": { + "regexp": "(.*?)" + }, + "endsPattern": { + "regexp": "bundle generation complete" + } + } + } + }, + { + "type": "npm", + "script": "test", + "isBackground": true, + "problemMatcher": { + "owner": "typescript", + "pattern": "$tsc", + "background": { + "activeOnStart": true, + "beginsPattern": { + "regexp": "(.*?)" + }, + "endsPattern": { + "regexp": "bundle generation complete" + } + } + } + } + ] + } + \ No newline at end of file