#!/bin/bash # MAC OS 만 실행 # if [[ "$(uname -s)" != "Darwin" ]]; then # echo "This script runs on MAC OS only." # echo "Current OS: $(uname -s)" # exit 1 # fi # Git 관련 스크립트 실행 ./dev_git_only.sh echo "Starting Development Environment..." # 환경 변수 파일 로드 if [ -f .env.development ]; then echo "Loading development environment variables..." set -a source .env.development set +a else echo "Error: .env.development file not found!" exit 1 fi export NODE_ENV=development # 이전 컨테이너 정리 docker-compose -f docker-compose.localdev.yml down echo "Pruning Docker system..." # 컨테이너 정리 docker system prune -af docker image prune -af docker volume prune -af # Git 관련 명령어 실행 git reset --hard git checkout main # 강제로 리모트 브랜치의 내용을 가져옴 if ! git fetch origin; then echo "Git fetch failed. Exiting script." exit 1 fi if ! git reset --hard origin/main; then echo "Git reset failed. Exiting script." exit 1 fi # 컨테이너 상태 확인 echo "Checking container status..." docker-compose -f docker-compose.localdev.yml up --build --force-recreate -d echo "Development environment setup complete!"