mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
fix: improve docker-compose npm install permissions and use npm ci
Fixes permission denied errors when installing dependencies in Docker containers: Changes: - Remove stale node_modules directories before installing (fresh start) - Use 'npm ci --force' instead of 'npm install --force' for deterministic installs - Add chmod to ensure writable permissions on node_modules - Properly fix directory ownership and permissions before install This prevents EACCES errors when multiple processes try to write to node_modules and handles lingering permission issues from previous failed container runs.
This commit is contained in:
@@ -76,12 +76,16 @@ services:
|
||||
- |
|
||||
# Fix permissions on node_modules (created as root by Docker volume)
|
||||
echo 'Fixing node_modules permissions...'
|
||||
chown -R automaker:automaker /app/node_modules 2>/dev/null || true
|
||||
rm -rf /app/node_modules 2>/dev/null || true
|
||||
rm -rf /app/apps/ui/node_modules 2>/dev/null || true
|
||||
mkdir -p /app/node_modules
|
||||
chown -R automaker:automaker /app/node_modules
|
||||
chmod -R u+rwX /app/node_modules
|
||||
|
||||
# Run the rest as automaker user
|
||||
exec gosu automaker sh -c "
|
||||
echo 'Installing dependencies...' &&
|
||||
npm install --force &&
|
||||
npm ci --force &&
|
||||
echo 'Building shared packages...' &&
|
||||
npm run build:packages &&
|
||||
echo 'Starting server in development mode...' &&
|
||||
|
||||
@@ -77,12 +77,16 @@ services:
|
||||
- |
|
||||
# Fix permissions on node_modules (created as root by Docker volume)
|
||||
echo 'Fixing node_modules permissions...'
|
||||
chown -R automaker:automaker /app/node_modules 2>/dev/null || true
|
||||
rm -rf /app/node_modules 2>/dev/null || true
|
||||
rm -rf /app/apps/ui/node_modules 2>/dev/null || true
|
||||
mkdir -p /app/node_modules
|
||||
chown -R automaker:automaker /app/node_modules
|
||||
chmod -R u+rwX /app/node_modules
|
||||
|
||||
# Run the rest as automaker user
|
||||
exec gosu automaker sh -c "
|
||||
echo 'Installing dependencies...' &&
|
||||
npm install --force &&
|
||||
npm ci --force &&
|
||||
echo 'Building shared packages...' &&
|
||||
npm run build:packages &&
|
||||
echo 'Starting server in development mode...' &&
|
||||
|
||||
Reference in New Issue
Block a user