Skip to content

Commit

Permalink
feat: adds dev container support (#1264)
Browse files Browse the repository at this point in the history
Signed-off-by: vajonam <[email protected]>
Co-authored-by: Pedro Lamas <[email protected]>
  • Loading branch information
vajonam and pedrolamas authored Dec 11, 2023
1 parent 306992a commit 7c57a9e
Show file tree
Hide file tree
Showing 8 changed files with 179 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM alpine:3.18

RUN \
apk update \
&& apk add \
git \
git-zsh-completion \
nodejs \
npm \
openssh \
sudo \
shadow \
zsh \
zsh-completions \
&& rm -f /etc/apk/cache/* /root/.cache \
&& groupadd vscode \
&& useradd -s /bin/zsh --gid vscode -m vscode \
&& echo vscode ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/vscode \
&& chmod 0440 /etc/sudoers.d/vscode \
&& mkdir -p "/home/vscode" \
&& chown vscode:vscode "/home/vscode"

USER vscode

RUN \
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
37 changes: 37 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/alpine
{
"name": "Fluidd Dev",
"dockerComposeFile": "docker-compose.yml",
"service": "fluidd",
"workspaceFolder": "/workspaces/fluidd",
"forwardPorts": [5000, 8080, 7125, 8110],
"features": {
},
"postCreateCommand": "npm ci && npm run bootstrap",
"customizations": {
"vscode": {
"extensions": [
"davidanson.vscode-markdownlint",
"dbaeumer.vscode-eslint",
"eamodio.gitlens",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"lukas-tr.materialdesignicons-intellisense",
"ms-azuretools.vscode-docker",
"redhat.vscode-yaml",
"vue.volar",
"vue.vscode-typescript-vue-plugin"
],
"settings": {
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"i18n-ally.localesPaths": [
"src/locales"
]
}
}
},
"remoteUser": "vscode"
}
27 changes: 27 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: '3.8'

services:
fluidd:
build:
context: ./
volumes:
- ..:/workspaces/fluidd/:cached
command: sleep infinity
networks:
- fluidd-dev
ports:
- "5000:5000"
- "8080:8080"

klipper-simulavr:
image: ei99070/docker-klipper-simulavr:latest
restart: unless-stopped
networks:
- fluidd-dev
ports:
- "7125:7125"
- "8110:8080"

networks:
fluidd-dev:
driver: bridge
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ pnpm-debug.log*

# Editor directories and files
.idea
.vscode
.vscode/*
!.vscode/extensions.json
!.vscode/launch.json
!.vscode/settings.default.json
!.vscode/tasks.json
*.suo
*.ntvs*
*.njsproj
Expand Down
14 changes: 14 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"recommendations": [
"davidanson.vscode-markdownlint",
"dbaeumer.vscode-eslint",
"eamodio.gitlens",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"lukas-tr.materialdesignicons-intellisense",
"ms-azuretools.vscode-docker",
"redhat.vscode-yaml",
"vue.volar",
"vue.vscode-typescript-vue-plugin"
]
}
24 changes: 24 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Chrome",
"request": "launch",
"type": "chrome",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}",
"preLaunchTask": "Serve"
},
{
"name": "Launch Edge",
"request": "launch",
"type": "msedge",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}",
"preLaunchTask": "Serve"
}
]
}
8 changes: 8 additions & 0 deletions .vscode/settings.default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"i18n-ally.localesPaths": [
"src/locales"
]
}
38 changes: 38 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Serve",
"type": "npm",
"script": "serve",
"problemMatcher": [
"$vite"
],
"isBackground": true
},
{
"label": "Build",
"type": "npm",
"script": "build",
"problemMatcher": []
},
{
"label": "Type check",
"type": "npm",
"script": "type-check",
"problemMatcher": []
},
{
"label": "Circular reference check",
"type": "npm",
"script": "circular-check",
"problemMatcher": []
},
{
"label": "Lint",
"type": "npm",
"script": "lint",
"problemMatcher": []
}
]
}

0 comments on commit 7c57a9e

Please sign in to comment.