Fix dev compose: npm install on container startup
The ./server bind mount overwrites /app/server including node_modules installed during the Docker build. Running npm install on startup ensures deps are present after the volume mount. Also reverts the node_modules named-volume workaround in favor of this cleaner approach (requires node installed locally for non-Docker dev). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,13 @@
|
||||
"Bash(docker --version)",
|
||||
"Bash(docker compose:*)",
|
||||
"Bash(docker build:*)",
|
||||
"Bash(docker run:*)"
|
||||
"Bash(docker run:*)",
|
||||
"Bash(export PATH=\"/home/christian/.nvm/versions/node/v24.14.0/bin:$PATH\")",
|
||||
"Bash(npm install:*)",
|
||||
"Bash(npm run:*)",
|
||||
"Bash(/home/christian/.nvm/versions/node/v24.14.0/bin/npm run:*)",
|
||||
"Bash(PATH=\"/home/christian/.nvm/versions/node/v24.14.0/bin:$PATH\" npm run build 2>&1)",
|
||||
"Bash(PATH=\"/home/christian/.nvm/versions/node/v24.14.0/bin:$PATH\" npx vite build 2>&1)"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
1719
client/package-lock.json
generated
Normal file
1719
client/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,14 +2,9 @@ services:
|
||||
app:
|
||||
volumes:
|
||||
- ./server:/app/server
|
||||
- server_node_modules:/app/server/node_modules
|
||||
- ./client:/app/client
|
||||
- client_node_modules:/app/client/node_modules
|
||||
ports:
|
||||
- "5173:5173"
|
||||
environment:
|
||||
NODE_ENV: development
|
||||
|
||||
volumes:
|
||||
server_node_modules:
|
||||
client_node_modules:
|
||||
command: sh -c "npm install && node src/index.js"
|
||||
|
||||
1391
server/package-lock.json
generated
Normal file
1391
server/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user