generated from devcontainers/feature-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
305 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
### Ensure correct access rights | ||
sudo chown -Rf vscode ${containerWorkspaceFolder:-.}/* ${containerWorkspaceFolder:-.}/.* | ||
sudo chmod -Rf 755 ${containerWorkspaceFolder:-.}/* ${containerWorkspaceFolder:-.}/.* | ||
|
||
#### Create aliases | ||
sudo cat <<EOF > ~/.bash_aliases | ||
alias part='php artisan' | ||
alias sart='sail artisan' | ||
alias snpm='sail npm' | ||
alias snpx='sail npx --yes' | ||
alias spm2='sail npx --yes pm2' | ||
alias smix='spm2 restart MixWatch' | ||
alias smiw='spm2 --name MixWatch start npm -- run watch' | ||
alias gitv='gitversion' | ||
alias sail='sh $([ -f sail ] && echo sail || echo vendor/bin/sail)' | ||
EOF | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,98 @@ | ||
{ | ||
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bookworm", | ||
"name": "Perspikapps/DevContainer", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/base:jammy", | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
"features": { | ||
"ghcr.io/devcontainers/features/node": "lts", | ||
"ghcr.io/devcontainers/features/php": "lts", | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": "lts", | ||
"ghcr.io/tomgrv/devcontainer-features/gitutils:1": {}, | ||
"ghcr.io/tomgrv/devcontainer-features/githooks:1": {} | ||
}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "sh .devcontainer/create.sh", | ||
// Configure tool-specific properties. | ||
"customizations": { | ||
"vscode": { | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"json.schemas": [ | ||
{ | ||
"fileMatch": ["*/devcontainer-feature.json"], | ||
"url": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainerFeature.schema.json" | ||
} | ||
"triggerTaskOnSave.tasks": { | ||
"php-refresh-config": [ | ||
"**/config.php", | ||
"config/*.php", | ||
".env" | ||
], | ||
"php-refresh-views": [ | ||
//"packages/**/*.blade.php" | ||
], | ||
"php-refresh-routes": ["**/[Rr]outes/*.php"], | ||
"php-refresh-db": [ | ||
// "**/migrations/*.php" | ||
] | ||
}, | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true, | ||
"todo-tree.general.tags": [ | ||
"BUG", | ||
"HACK", | ||
"FIXME", | ||
"TODO", | ||
"XXX", | ||
"[ ]", | ||
"[x]", | ||
"NOTE" | ||
], | ||
"conventionalCommits.gitmoji": false, | ||
"explorer.excludeGitIgnore": true | ||
}, | ||
"extensions": [ | ||
"mads-hartmann.bash-ide-vscode", | ||
"mhutchie.git-graph" | ||
"vivaxy.vscode-conventional-commits", | ||
"actboy168.tasks", | ||
"spmeesseman.vscode-taskexplorer", | ||
"gruntfuggly.triggertaskonsave", | ||
"entexa.tall-stack", | ||
"github.codespaces", | ||
"natizyskunk.sftp", | ||
"formulahendry.auto-rename-tag", | ||
"formulahendry.auto-close-tag", | ||
"absszero.vscode-laravel-goto", | ||
"marabesi.php-import-checker", | ||
"alexcvzz.vscode-sqlite", | ||
"bmewburn.vscode-intelephense-client", | ||
"gruntfuggly.todo-tree", | ||
"onecentlin.laravel-blade", | ||
"github.copilot", | ||
"github.copilot-chat", | ||
"donjayamanne.githistory", | ||
"xdebug.php-debug", | ||
"tomblind.scm-buttons-vscode", | ||
"misterj.laravel-expack", | ||
"devsense.composer-php-vscode", | ||
"mhutchie.git-graph", | ||
"christian-kohler.npm-intellisense", | ||
"davidanson.vscode-markdownlint", | ||
"github.vscode-github-actions", | ||
"pcbowers.alpine-intellisense", | ||
"softwareape.rebaser", | ||
"arturock.gitstash" | ||
] | ||
} | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {}, | ||
"ghcr.io/tomgrv/devcontainer-features/gitutils": {}, | ||
"ghcr.io/tomgrv/devcontainer-features/githooks": {} | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
// Define env vars to set in the container. | ||
"remoteEnv": { | ||
"APP_DEBUG": "true", | ||
"APP_ENV": "local", | ||
"APP_PORT": "80", | ||
"LARAVEL_SAIL": "1", | ||
"SAIL_XDEBUG_MODE": "develop,debug", | ||
"SAIL_XDEBUG_CONFIG": "client_host=host.docker.internal idekey=vscode", | ||
"XDEBUG_MODE": "off" | ||
}, | ||
"updateContentCommand": "npm install -g @devcontainers/cli" | ||
// Ensure the container is correctly configured for the workspace. | ||
"postStartCommand": "sh .devcontainer/start.sh" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
|
||
### Make sure the workspace folder is owned by the user | ||
git config --global --add safe.directory ${containerWorkspaceFolder:-.} | ||
|
||
### Install composer dependencies if composer.json exists | ||
if [ -f ${containerWorkspaceFolder:-.}/composer.json ]; then | ||
composer install --ignore-platform-reqs --no-interaction --no-progress | ||
fi | ||
|
||
### Install npm dependencies if package.json exists | ||
if [ -f ${containerWorkspaceFolder:-.}/package.json ]; then | ||
npm install --ws --if-present --include-workspace-root | ||
fi | ||
|
||
### Init laravel | ||
if [ -f ${containerWorkspaceFolder:-.}/vendor/bin/sail ] && [ "${LARAVEL_SAIL}" -eq "1" ]; then | ||
|
||
${containerWorkspaceFolder:-.}/vendor/bin/sail up --build -d | ||
${containerWorkspaceFolder:-.}/vendor/bin/sail artisan key:generate --force | ||
${containerWorkspaceFolder:-.}/vendor/bin/sail artisan config:cache | ||
${containerWorkspaceFolder:-.}/vendor/bin/sail artisan view:cache | ||
${containerWorkspaceFolder:-.}/vendor/bin/sail artisan route:cache | ||
${containerWorkspaceFolder:-.}/vendor/bin/sail artisan migrate --seed | ||
${containerWorkspaceFolder:-.}/vendor/bin/sail npx --yes pm2 --name MixWatch start npm -- run watch | ||
|
||
elif [ -f ${containerWorkspaceFolder:-.}/artisan ]; then | ||
touch $DB_DATABASE | ||
echo APP_KEY=null > .env | ||
php -d xdebug.mode=off artisan key:generate --force | ||
php -d xdebug.mode=off artisan config:cache | ||
php -d xdebug.mode=off artisan view:cache | ||
php -d xdebug.mode=off artisan route:cache | ||
php -d xdebug.mode=off artisan migrate --seed | ||
npx --yes pm2 --name MixWatch start npm -- run watch | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
### Ensure correct access rights | ||
sudo chown -Rf vscode ${containerWorkspaceFolder:-.}/* ${containerWorkspaceFolder:-.}/.* | ||
sudo chmod -Rf 755 ${containerWorkspaceFolder:-.}/* ${containerWorkspaceFolder:-.}/.* | ||
|
||
#### Create aliases | ||
sudo cat <<EOF > ~/.bash_aliases | ||
alias part='php artisan' | ||
alias sart='sail artisan' | ||
alias snpm='sail npm' | ||
alias snpx='sail npx --yes' | ||
alias spm2='sail npx --yes pm2' | ||
alias smix='spm2 restart MixWatch' | ||
alias smiw='spm2 --name MixWatch start npm -- run watch' | ||
alias gitv='gitversion' | ||
alias sail='sh $([ -f sail ] && echo sail || echo vendor/bin/sail)' | ||
EOF | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
{ | ||
"name": "Perspikapps/DevContainer", | ||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile | ||
"image": "mcr.microsoft.com/devcontainers/base:jammy", | ||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
"features": { | ||
"ghcr.io/devcontainers/features/node": "lts", | ||
"ghcr.io/devcontainers/features/php": "lts", | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": "lts", | ||
"ghcr.io/tomgrv/devcontainer-features/gitutils:1": {}, | ||
"ghcr.io/tomgrv/devcontainer-features/githooks:1": {} | ||
}, | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "sh .devcontainer/create.sh", | ||
// Configure tool-specific properties. | ||
"customizations": { | ||
"vscode": { | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"triggerTaskOnSave.tasks": { | ||
"php-refresh-config": [ | ||
"**/config.php", | ||
"config/*.php", | ||
".env" | ||
], | ||
"php-refresh-views": [ | ||
//"packages/**/*.blade.php" | ||
], | ||
"php-refresh-routes": ["**/[Rr]outes/*.php"], | ||
"php-refresh-db": [ | ||
// "**/migrations/*.php" | ||
] | ||
}, | ||
"editor.formatOnSave": true, | ||
"editor.formatOnPaste": true, | ||
"todo-tree.general.tags": [ | ||
"BUG", | ||
"HACK", | ||
"FIXME", | ||
"TODO", | ||
"XXX", | ||
"[ ]", | ||
"[x]", | ||
"NOTE" | ||
], | ||
"conventionalCommits.gitmoji": false, | ||
"explorer.excludeGitIgnore": true | ||
}, | ||
"extensions": [ | ||
"vivaxy.vscode-conventional-commits", | ||
"actboy168.tasks", | ||
"spmeesseman.vscode-taskexplorer", | ||
"gruntfuggly.triggertaskonsave", | ||
"entexa.tall-stack", | ||
"github.codespaces", | ||
"natizyskunk.sftp", | ||
"formulahendry.auto-rename-tag", | ||
"formulahendry.auto-close-tag", | ||
"absszero.vscode-laravel-goto", | ||
"marabesi.php-import-checker", | ||
"alexcvzz.vscode-sqlite", | ||
"bmewburn.vscode-intelephense-client", | ||
"gruntfuggly.todo-tree", | ||
"onecentlin.laravel-blade", | ||
"github.copilot", | ||
"github.copilot-chat", | ||
"donjayamanne.githistory", | ||
"xdebug.php-debug", | ||
"tomblind.scm-buttons-vscode", | ||
"misterj.laravel-expack", | ||
"devsense.composer-php-vscode", | ||
"mhutchie.git-graph", | ||
"christian-kohler.npm-intellisense", | ||
"davidanson.vscode-markdownlint", | ||
"github.vscode-github-actions", | ||
"pcbowers.alpine-intellisense", | ||
"softwareape.rebaser", | ||
"arturock.gitstash" | ||
] | ||
} | ||
}, | ||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. | ||
// "remoteUser": "root" | ||
// Define env vars to set in the container. | ||
"remoteEnv": { | ||
"APP_DEBUG": "true", | ||
"APP_ENV": "local", | ||
"APP_PORT": "80", | ||
"LARAVEL_SAIL": "1", | ||
"SAIL_XDEBUG_MODE": "develop,debug", | ||
"SAIL_XDEBUG_CONFIG": "client_host=host.docker.internal idekey=vscode", | ||
"XDEBUG_MODE": "off" | ||
}, | ||
// Ensure the container is correctly configured for the workspace. | ||
"postStartCommand": "sh .devcontainer/start.sh" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
|
||
### Make sure the workspace folder is owned by the user | ||
git config --global --add safe.directory ${containerWorkspaceFolder:-.} | ||
|
||
### Install composer dependencies if composer.json exists | ||
if [ -f ${containerWorkspaceFolder:-.}/composer.json ]; then | ||
composer install --ignore-platform-reqs --no-interaction --no-progress | ||
fi | ||
|
||
### Install npm dependencies if package.json exists | ||
if [ -f ${containerWorkspaceFolder:-.}/package.json ]; then | ||
npm install --ws --if-present --include-workspace-root | ||
fi | ||
|
||
### Init laravel | ||
if [ -f ${containerWorkspaceFolder:-.}/vendor/bin/sail ] && [ "${LARAVEL_SAIL}" -eq "1" ]; then | ||
|
||
${containerWorkspaceFolder:-.}/vendor/bin/sail up --build -d | ||
${containerWorkspaceFolder:-.}/vendor/bin/sail artisan key:generate --force | ||
${containerWorkspaceFolder:-.}/vendor/bin/sail artisan config:cache | ||
${containerWorkspaceFolder:-.}/vendor/bin/sail artisan view:cache | ||
${containerWorkspaceFolder:-.}/vendor/bin/sail artisan route:cache | ||
${containerWorkspaceFolder:-.}/vendor/bin/sail artisan migrate --seed | ||
${containerWorkspaceFolder:-.}/vendor/bin/sail npx --yes pm2 --name MixWatch start npm -- run watch | ||
|
||
elif [ -f ${containerWorkspaceFolder:-.}/artisan ]; then | ||
touch $DB_DATABASE | ||
echo APP_KEY=null > .env | ||
php -d xdebug.mode=off artisan key:generate --force | ||
php -d xdebug.mode=off artisan config:cache | ||
php -d xdebug.mode=off artisan view:cache | ||
php -d xdebug.mode=off artisan route:cache | ||
php -d xdebug.mode=off artisan migrate --seed | ||
npx --yes pm2 --name MixWatch start npm -- run watch | ||
fi |