#!/bin/bash

# Create namespace
kubectl create namespace sensor-app

# Create directory for persistent volume if not exists
sudo mkdir -p /mnt/data
sudo chmod 777 /mnt/data

# Build Docker images
echo "Building web application image..."
docker build -t floorplan-webapp:latest -f Dockerfile .

echo "Building MySQL database image..."
docker build -t mysql-db:latest -f Dockerfile.mysql .

echo "Application prepared successfully!"