cheekylist/dev-docker.sh
2025-07-25 15:23:52 +02:00

39 lines
No EOL
1 KiB
Bash
Executable file

#!/bin/bash
# Development script using Docker with hot reload support
# This script builds and runs the development container
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Function to cleanup
cleanup() {
echo -e "\n${YELLOW}🛑 Shutting down development container...${NC}"
docker-compose -f docker-compose.dev.yml down
echo -e "${GREEN}✅ Development environment stopped${NC}"
exit 0
}
# Set up signal handlers
trap cleanup SIGINT SIGTERM
echo -e "${BLUE}🚀 Starting GoCheck development environment with Docker...${NC}"
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo -e "${RED}❌ Docker is not running. Please start Docker and try again.${NC}"
exit 1
fi
# Build and start the development container
echo -e "${YELLOW}📦 Building development container...${NC}"
docker-compose -f docker-compose.dev.yml up --build
# The container will keep running until interrupted
# When interrupted, the cleanup function will be called