#!/bin/bash # Fix Docker with simpler startup templates=( "devforge" "mobilefirst" "saasify" "startupkit" "analyticsdash" "blog" "changelog" "ai-chat" "search" "ecommerce" "api-docs" ) for template in "${templates[@]}"; do dir="templates-repos/$template" if [ -d "$dir" ]; then echo "📦 Fixing $template Docker..." cd "$dir" # Create simpler Dockerfile cat > Dockerfile << 'EOF' FROM node:20-slim WORKDIR /app # Copy everything COPY . . # Install dependencies RUN npm ci --legacy-peer-deps # Build the app RUN npm run build # Expose port EXPOSE 3000 # Start with npm start CMD ["npm", "start"] EOF # Ensure package.json has proper start script if ! grep -q '"start":' package.json; then # Update package.json to add start script sed -i '' 's/"scripts": {/"scripts": {\n "start": "next start -H 0.0.0.0 -p 3000",/' package.json fi # Remove standalone config from next.config.js if [ -f next.config.js ]; then sed -i '' "/output: 'standalone'/d" next.config.js fi # Commit and push git add -A git commit -m "Simplify Docker startup" 2>/dev/null || true git push hf main --force cd ../.. echo " ✅ Fixed $template" fi done echo "" echo "✅ All templates fixed with simple Docker!"