secureweb/install.sh
Mahmoud Emad e2eb77c3b9 feat: Add Dockerfile and simplify install script
- Add a Dockerfile for easy building and running of the application.
- Simplify the install.sh script by removing unnecessary steps and
  hardcoded values.  The installation of Tailwind CSS and Shadcn UI
  is now handled within the application.  This allows for greater
  flexibility and simplifies the process.
- Use environment variables for HOST and PORT, providing defaults.
2025-05-11 17:59:50 +03:00

66 lines
1.6 KiB
Bash
Executable File

#!/bin/bash -ex
# Change to the directory at the top
cd "$(dirname "$0")"
# Check if Bun is installed
if ! command -v bun &> /dev/null
then
echo "Bun not found, installing..."
curl -fsSL https://bun.sh/install | bash
# Add bun to PATH for the current session
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
else
echo "Bun is already installed."
fi
# Change into the existing app directory
echo "Changing to the sweb directory..."
cd sweb
# Install dependencies
bun install
# # Install Tailwind CSS and dependencies
# echo "Installing Tailwind CSS and dependencies..."
# bun add -D tailwindcss postcss autoprefixer
# # Initialize Tailwind CSS
# echo "Initializing Tailwind CSS..."
# bunx tailwindcss init -p
# # Configure Tailwind CSS
# echo "Configuring Tailwind CSS..."
# # Modify tailwind.config.js
# cat << EOF > tailwind.config.js
# /** @type {import('tailwindcss').Config} */
# export default {
# content: [
# './src/**/*.{html,js,svelte,ts}',
# ],
# theme: {
# extend: {},
# },
# plugins: [],
# }
# EOF
# # Add Tailwind directives to app.css
# echo "Adding Tailwind directives to app.css..."
# cat << EOF > src/app.css
# @tailwind base;
# @tailwind components;
# @tailwind utilities;
# $(cat src/app.css)
# EOF
# # Install Shadcn for Svelte
# echo "Installing Shadcn for Svelte..."
# bun install lucide-svelte
# # Attempting to run Shadcn Svelte init non-interactively by providing the components alias.
# bunx shadcn-svelte init --style default --base-color slate --css src/app.css --tailwind-config tailwind.config.js --components-alias '$lib/components/ui'