- Updated .env.example and .env files for backend and frontend with placeholder values. - Enhanced .gitignore to include additional files and directories. - Modified docker-compose.yml to change image names and improve service health checks. - Updated README.md and SETUP_THE_PROJECT.md for clearer setup instructions. - Added database initialization scripts and SQL files for structured database setup. - Updated frontend Dockerfile to use Node.js 22 and adjusted package.json scripts. - Improved error handling and logging in start scripts for better debugging. - Added reCAPTCHA support in the signup page with conditional loading based on environment variables.
102 lines
3.1 KiB
Bash
102 lines
3.1 KiB
Bash
#!/bin/bash
|
|
|
|
# Colors for terminal output
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
RED='\033[0;31m'
|
|
NC='\033[0m' # No Color
|
|
|
|
# Print banner
|
|
echo -e "${GREEN}"
|
|
echo " __ __ _ _"
|
|
echo " \ \ / / | | | |"
|
|
echo " \ \ /\ / /__ _ __| | _| | ___ _ __ ____"
|
|
echo " \ \/ \/ / _ \| '__| |/ / |/ _ \ '_ \|_ /"
|
|
echo " \ /\ / (_) | | | <| | __/ | | |/ /"
|
|
echo " \/ \/ \___/|_| |_|\_\_|\___|_| |_/___|"
|
|
echo ""
|
|
echo " W O R K L E N Z "
|
|
echo -e "${NC}"
|
|
echo "Starting Worklenz Docker Environment..."
|
|
|
|
# Check if .env file exists
|
|
if [ ! -f .env ]; then
|
|
echo -e "${YELLOW}Warning: .env file not found. Using default configuration.${NC}"
|
|
# Copy the example .env file if it exists
|
|
if [ -f .env.example ]; then
|
|
cp .env.example .env
|
|
echo "Created .env file from .env.example"
|
|
fi
|
|
fi
|
|
|
|
# Check if Docker is installed
|
|
if ! command -v docker &> /dev/null; then
|
|
echo -e "${RED}Error: Docker is not installed or not in PATH${NC}"
|
|
echo "Please install Docker first: https://docs.docker.com/get-docker/"
|
|
exit 1
|
|
fi
|
|
|
|
# Check if Docker daemon is running
|
|
echo "Running preflight checks..."
|
|
if ! docker info &> /dev/null; then
|
|
echo -e "${RED}Error: Docker daemon is not running${NC}"
|
|
echo "Please start Docker and try again"
|
|
exit 1
|
|
fi
|
|
echo -e "${GREEN}✓${NC} Docker is running"
|
|
|
|
# Check if Docker Compose is installed
|
|
if ! command -v docker compose &> /dev/null; then
|
|
echo "Warning: Docker Compose V2 not found, trying docker-compose command..."
|
|
if ! command -v docker-compose &> /dev/null; then
|
|
echo "Error: Docker Compose is not installed or not in PATH"
|
|
echo "Please install Docker Compose: https://docs.docker.com/compose/install/"
|
|
exit 1
|
|
fi
|
|
# Use docker-compose command instead
|
|
docker-compose down
|
|
docker-compose up -d
|
|
else
|
|
# Use Docker Compose V2
|
|
docker compose down
|
|
docker compose up -d
|
|
fi
|
|
|
|
# Wait for services to be ready
|
|
echo "Waiting for services to start..."
|
|
sleep 5
|
|
|
|
# Check if services are running
|
|
if docker ps | grep -q "worklenz_frontend"; then
|
|
echo -e "${GREEN}✓${NC} Frontend is running"
|
|
FRONTEND_URL="http://localhost:5000"
|
|
echo " Frontend URL: $FRONTEND_URL"
|
|
else
|
|
echo "✗ Frontend service failed to start"
|
|
fi
|
|
|
|
if docker ps | grep -q "worklenz_backend"; then
|
|
echo -e "${GREEN}✓${NC} Backend is running"
|
|
BACKEND_URL="http://localhost:3000"
|
|
echo " Backend URL: $BACKEND_URL"
|
|
else
|
|
echo "✗ Backend service failed to start"
|
|
fi
|
|
|
|
if docker ps | grep -q "worklenz_minio"; then
|
|
echo -e "${GREEN}✓${NC} MinIO is running"
|
|
MINIO_URL="http://localhost:9001"
|
|
echo " MinIO Console URL: $MINIO_URL (login: minioadmin/minioadmin)"
|
|
else
|
|
echo "✗ MinIO service failed to start"
|
|
fi
|
|
|
|
if docker ps | grep -q "worklenz_db"; then
|
|
echo -e "${GREEN}✓${NC} Database is running"
|
|
else
|
|
echo "✗ Database service failed to start"
|
|
fi
|
|
|
|
echo -e "\n${GREEN}Worklenz is now running!${NC}"
|
|
echo "You can access the application at: http://localhost:5000"
|
|
echo "To stop the services, run: docker compose down" |