Skip to content

Commit 92367cf

Browse files
node_modulesをvolume化して高速化+パーミッション問題回避、git submodule update時にローカルにsubmoduleがあっても問題が起こらないようにする (#13956)
1 parent ff3a38a commit 92367cf

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

.devcontainer/devcontainer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"ghcr.io/devcontainers-contrib/features/corepack:1": {}
1111
},
1212
"forwardPorts": [3000],
13-
"postCreateCommand": "sudo chmod 755 .devcontainer/init.sh && .devcontainer/init.sh",
13+
"postCreateCommand": "/bin/bash .devcontainer/init.sh",
1414
"customizations": {
1515
"vscode": {
1616
"extensions": [

.devcontainer/docker-compose.yml

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ services:
88

99
volumes:
1010
- ../:/workspace:cached
11+
- node_modules:/workspace/node_modules
1112

1213
command: sleep infinity
1314

@@ -46,6 +47,7 @@ services:
4647
volumes:
4748
postgres-data:
4849
redis-data:
50+
node_modules:
4951

5052
networks:
5153
internal_network:

.devcontainer/init.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
set -xe
44

5-
sudo chown -R node /workspace
5+
sudo chown node node_modules
6+
git config --global --add safe.directory /workspace
67
git submodule update --init
78
corepack install
89
corepack enable

0 commit comments

Comments
 (0)