Skip to content

Commit

Permalink
chore: add devcontainer
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoMendes98 authored and Mendes Hugo committed Jan 24, 2024
1 parent 0bfdb53 commit e19840c
Show file tree
Hide file tree
Showing 340 changed files with 4,481 additions and 2,632 deletions.
10 changes: 10 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM mcr.microsoft.com/devcontainers/typescript-node:20

# To be able to run Cypress (no studio available in `codespace`)
# RUN apt-get install -y --no-install-recommends libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb

# From https://github.com/devcontainers/features/tree/main/src/desktop-lite
# TODO: after enabling the desktop feature
# RUN apt install -y firefox-esr
# RUN curl -sSL https://dl.google.com/linux/direct/google-chrome-stable_current_$(dpkg --print-architecture).deb -o /tmp/chrome.deb \
# && apt-get -y install /tmp/chrome.deb && rm /tmp/chrome.deb
65 changes: 65 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"build": {
"dockerfile": "Dockerfile"
},
"customizations": {
"vscode": {
"extensions": [
"Angular.ng-template",
"EditorConfig.EditorConfig",
"GitHub.vscode-pull-request-github",
"Gruntfuggly.todo-tree",
"dbaeumer.vscode-eslint",
"exiasr.hadolint",
"firsttris.vscode-jest-runner",
"formulahendry.auto-close-tag",
"formulahendry.auto-rename-tag",
"github.vscode-github-actions",
"hediet.vscode-drawio",
"king2021.vnc-extension",
"mhutchie.git-graph",
"ms-azuretools.vscode-docker",
"mtxr.sqltools",
"mtxr.sqltools-driver-pg",
"nrwl.angular-console",
"redhat.vscode-yaml",
"stylelint.vscode-stylelint",
"vivaxy.vscode-conventional-commits",
"waderyan.gitblame",
"yoavbls.pretty-ts-errors"
],
"settings": {
// Ensure correct node version
"eslint.runtime": "/usr/local/bin/node"
}
}
},
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"configureZshAsDefaultShell": true
},
"ghcr.io/devcontainers/features/desktop-lite:1": {
"password": "vscode",
"vncPort": 5903
},
// TODO: determine better options and configure
// "ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/dhoeric/features/hadolint:1": {}
},
"forwardPorts": [5903, 6080],
"name": "Dev environment",
// Be sure to install the node_modules in and for the container before starting it, as some plugins might rely on it (e.g. eslint)
//"onCreateCommand": "rm -rf node_modules; npm install",
"portsAttributes": {
"5903": {
"label": "desktop VNC"
},
"6080": {
"label": "desktop web"
}
},
"postCreateCommand": "echo \"PATH=\"${PATH}:${PWD}/node_modules/.bin\"\" >> ~/.zshrc",
// docker is not nice :(. It cleans the `/tmp` dir which contains the vnc password, so it is "restarted"
"postStartCommand": "npx nx reset; killall tigervncserver"
}
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ charset = utf-8
indent_size = 4
indent_style = tab
insert_final_newline = true
max_line_length = 100
max_line_length = 80
tab_width = 4
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false

[*.yml]
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ package-lock.json
!.github/
!.github/workflows/*.yml

!.devcontainer/
!.vscode/
.vscode/*
!.vscode/extensions.json
Expand Down
Loading

0 comments on commit e19840c

Please sign in to comment.