gallery / simplify-all-docker.sh
Hanzo Dev
Add git submodule architecture for templates with Hugging Face integration
366fe97
#!/bin/bash
# Simplify all Docker files to use dev mode for faster startup
templates=(
"devforge"
"mobilefirst"
"saasify"
"startupkit"
"analyticsdash"
"ai-chat"
"ecommerce"
"blog"
)
for template in "${templates[@]}"; do
dir="templates-repos/$template"
if [ -d "$dir" ]; then
echo "📦 Simplifying $template Docker..."
cd "$dir"
# Create super simple Dockerfile
cat > Dockerfile << 'EOF'
FROM node:20-slim
WORKDIR /app
COPY . .
RUN npm install --legacy-peer-deps
EXPOSE 3000
CMD ["npm", "run", "dev"]
EOF
# Ensure dev script binds to all interfaces
if [ -f package.json ]; then
sed -i '' 's/"dev": "next dev"/"dev": "next dev -H 0.0.0.0 -p 3000"/' package.json 2>/dev/null || true
sed -i '' 's/"dev": "next dev -p 3000"/"dev": "next dev -H 0.0.0.0 -p 3000"/' package.json 2>/dev/null || true
fi
# Commit and push
git add Dockerfile package.json
git commit -m "Use dev mode in Docker for faster startup" 2>/dev/null || true
git push hf main --force
cd ../..
echo " ✅ Simplified $template"
fi
done
echo ""
echo "✅ All templates simplified for faster startup!"