Skip to content

Commit 3de5ba7

Browse files
Add support for VSCode devcontainer.
1 parent 4ec40bd commit 3de5ba7

File tree

2 files changed

+134
-1
lines changed

2 files changed

+134
-1
lines changed

Diff for: .devcontainer.json

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
{
2+
"name": "TripalDocker-BLAST",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"args": {
6+
"drupalversion": "10.4.x-dev",
7+
"phpversion": "8.3",
8+
"pgsqlversion": "16"
9+
}
10+
},
11+
"workspaceMount": "source=${localWorkspaceFolder},target=/var/www/drupal/web/modules/contrib/tripal_blast,type=bind",
12+
"workspaceFolder": "/var/www/drupal/web/modules/contrib/tripal_blast",
13+
"customizations": {
14+
"vscode": {
15+
"extensions": [
16+
"neilbrayfield.php-docblocker",
17+
"bmewburn.vscode-intelephense-client",
18+
"recca0120.vscode-phpunit",
19+
"swordev.phpstan",
20+
"andrewdavidblum.drupal-smart-snippets",
21+
"DEVSENSE.composer-php-vscode",
22+
"mblode.twig-language-2",
23+
"redhat.vscode-yaml",
24+
"ms-azuretools.vscode-docker",
25+
"github.vscode-github-actions",
26+
"GitHub.vscode-pull-request-github"
27+
],
28+
"settings": {
29+
// This turns off basic PHP suggestions provided by Visual Studio Code (in lieu of Intelephense's).
30+
"php.suggest.basic": false,
31+
/* Coding Standards */
32+
"css.validate": true,
33+
"diffEditor.ignoreTrimWhitespace": false,
34+
"editor.tabSize": 2,
35+
"editor.autoIndent": "full",
36+
"editor.insertSpaces": true,
37+
"editor.formatOnPaste": true,
38+
"editor.formatOnSave": false,
39+
"editor.renderWhitespace": "boundary",
40+
"editor.wordWrapColumn": 80,
41+
"editor.wordWrap": "on",
42+
"editor.detectIndentation": true,
43+
"editor.rulers": [
44+
80
45+
],
46+
"files.trimTrailingWhitespace": true,
47+
"files.insertFinalNewline": true,
48+
"files.trimFinalNewlines": true,
49+
"html.format.enable": true,
50+
"html.format.wrapLineLength": 80,
51+
/* Chosing which language a file is; Drupal-focused */
52+
"files.associations": {
53+
"*.inc": "php",
54+
"*.module": "php",
55+
"*.install": "php",
56+
"*.theme": "php",
57+
"*.profile": "php",
58+
"*.tpl.php": "php",
59+
"*.test": "php",
60+
"*.php": "php",
61+
"*.info": "ini",
62+
"*.html": "twig"
63+
},
64+
"emmet.includeLanguages": {
65+
"twig": "html"
66+
},
67+
/* Performance Related. Exludes from indexing */
68+
/*files.exclude and files.watcherExclude settings via https://github.com/microsoft/vscode/issues/11963#issuecomment-317830768 */
69+
"files.exclude": {
70+
"**/.git": true,
71+
"**/.svn": true,
72+
"**/.hg": true,
73+
"**/CVS": true,
74+
"**/.DS_Store": true,
75+
"**/tmp": true,
76+
"**/node_modules": true,
77+
"**/bower_components": true,
78+
"**/dist": true
79+
},
80+
"files.watcherExclude": {
81+
"**/.git/objects/**": true,
82+
"**/.git/subtree-cache/**": true,
83+
"**/node_modules/**": true,
84+
"**/tmp/**": true,
85+
"**/bower_components/**": true,
86+
"**/dist/**": true
87+
},
88+
/* PHP Linting */
89+
"php.validate.enable": true,
90+
"php.validate.executablePath": "/usr/local/bin/php",
91+
"php.validate.run": "onType",
92+
"[php]": {
93+
"editor.defaultFormatter": "bmewburn.vscode-intelephense-client"
94+
},
95+
/* PHP DocBlocker */
96+
"php-docblocker.gap": true,
97+
"php-docblocker.useShortNames": true,
98+
/* PHP Intelephense */
99+
// Intelephense and Drupal >8 only. This should be set to the path to web/index.php.
100+
"intelephense.environment.documentRoot": "/var/www/drupal/web/index.php",
101+
// Intelephense only: For Drupal compliant braces formatting use:
102+
"intelephense.format.braces": "k&r",
103+
// Indicate where to find additional classes.
104+
"intelephense.environment.includePaths": [
105+
"/var/www/drupal/web/core/",
106+
"/var/www/drupal/vendor/",
107+
"/var/www/drupal/web/modules/"
108+
],
109+
"intelephense.diagnostics.enable": false,
110+
/* PHPUnit Test Explorer */
111+
"phpunit.phpunit": "/var/www/drupal/vendor/bin/phpunit",
112+
/* Drupal Smart Snippets */
113+
// Use this to prioritize Drupal Smart Snippets in the UI.
114+
"editor.snippetSuggestions": "top",
115+
/* Composer */
116+
"composer.bin": "/usr/local/bin/composer",
117+
"tws.trimOnSave": true,
118+
"tws.highlightTrailingWhiteSpace": true
119+
}
120+
}
121+
},
122+
"forwardPorts": [
123+
80,
124+
5432,
125+
9003
126+
],
127+
"postCreateCommand": "init.sh"
128+
}

Diff for: Dockerfile

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG drupalversion='10.2.x-dev'
22
ARG phpversion='8.3'
33
ARG pgsqlversion="16"
4-
FROM tripalproject/tripaldocker:drupal${drupalversion}-php${phpversion}-pgsql${pgsqlversion}-noChado
4+
FROM tripalproject/tripaldocker:drupal${drupalversion}-php${phpversion}-pgsql${pgsqlversion}
55

66
LABEL org.opencontainers.image.source=https://github.com/tripal/tripal_blast
77
LABEL org.opencontainers.image.description="Provides a demonstration of the Tripal BLAST module installed in the most recent version of Tripal 4"
@@ -19,3 +19,8 @@ RUN cd / \
1919
WORKDIR /var/www/drupal/web/modules/contrib/tripal_blast
2020
RUN service postgresql restart \
2121
&& drush en tripal_blast --yes
22+
23+
## Set files directory permissions
24+
RUN chown -R www-data:www-data /var/www/drupal \
25+
&& chmod 775 -R /var/www/drupal/web/sites/default/files \
26+
&& usermod -g www-data root

0 commit comments

Comments
 (0)