Skip to content

Commit

Permalink
node_modulesをvolume化して高速化+パーミッション問題回避、git submodule update時にローカルにsubm…
Browse files Browse the repository at this point in the history
…oduleがあっても問題が起こらないようにする (#13956)
  • Loading branch information
oyakimochocho authored Jun 12, 2024
1 parent ff3a38a commit 92367cf
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"ghcr.io/devcontainers-contrib/features/corepack:1": {}
},
"forwardPorts": [3000],
"postCreateCommand": "sudo chmod 755 .devcontainer/init.sh && .devcontainer/init.sh",
"postCreateCommand": "/bin/bash .devcontainer/init.sh",
"customizations": {
"vscode": {
"extensions": [
Expand Down
2 changes: 2 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:

volumes:
- ../:/workspace:cached
- node_modules:/workspace/node_modules

command: sleep infinity

Expand Down Expand Up @@ -46,6 +47,7 @@ services:
volumes:
postgres-data:
redis-data:
node_modules:

networks:
internal_network:
Expand Down
3 changes: 2 additions & 1 deletion .devcontainer/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

set -xe

sudo chown -R node /workspace
sudo chown node node_modules
git config --global --add safe.directory /workspace
git submodule update --init
corepack install
corepack enable
Expand Down

0 comments on commit 92367cf

Please sign in to comment.