32 lines
780 B
Bash
Executable File
32 lines
780 B
Bash
Executable File
#!/bin/bash
|
|
# Exit on error
|
|
set -e
|
|
|
|
# Change directory to the Next.js project
|
|
echo "🚀 Building Next.js application..."
|
|
cd ../doormile-next
|
|
npm install
|
|
npm run build
|
|
|
|
# Go back to the build directory
|
|
echo "🧹 Preparing build context..."
|
|
cd ../doormile-build
|
|
rm -rf build
|
|
mkdir -p build
|
|
|
|
# Copy Next.js standalone server and dependencies
|
|
echo "📦 Copying standalone build files..."
|
|
cp -R ../doormile-next/.next/standalone/. ./build/
|
|
|
|
# Copy public folder and static assets
|
|
echo "📦 Copying public and static assets..."
|
|
cp -R ../doormile-next/public ./build/
|
|
mkdir -p ./build/.next
|
|
cp -R ../doormile-next/.next/static ./build/.next/
|
|
|
|
# Run the docker build
|
|
echo "🐳 Building Docker image..."
|
|
docker build -t doormile-app .
|
|
|
|
echo "✅ Docker build completed successfully!"
|