- Install su-exec in Dockerfile for user switching - Modified start.sh to create directories as root, then change ownership - Container starts as root but switches to nextjs user for app execution - This prevents permission denied errors when creating .storage directories
15 lines
403 B
Bash
15 lines
403 B
Bash
#!/bin/sh
|
|
|
|
# Create .storage directories if they don't exist (as root)
|
|
mkdir -p /app/.storage/users
|
|
mkdir -p /app/.storage/bookings
|
|
mkdir -p /app/.storage/treatments
|
|
mkdir -p /app/.storage/availability
|
|
mkdir -p /app/.storage/cancellation-tokens
|
|
|
|
# Change ownership to nextjs user
|
|
chown -R nextjs:nodejs /app/.storage
|
|
|
|
# Start the application as nextjs user
|
|
exec su-exec nextjs node server-dist/index.js
|