@@ -61,15 +61,38 @@ if ! curl -fsSL "${ENV_FILE_URL}" -o .env; then
6161fi
6262echo -e " ${GREEN} ✓${NC} Downloaded .env file"
6363
64- # Pull images
65- echo " "
66- echo -e " ${YELLOW} →${NC} Pulling Docker images (this may take a few minutes)..."
67- ${DOCKER_COMPOSE} -p " ${PROJECT_NAME} " pull
64+ # Download required data files
65+ echo -e " ${YELLOW} →${NC} Downloading required data files..."
66+
67+ # Create directories
68+ mkdir -p src/flagd src/postgres
69+
70+ # Download flagd configuration
71+ if ! curl -fsSL " https://raw.githubusercontent.com/${GITHUB_REPO} /${BRANCH} /src/flagd/demo.flagd.json" -o src/flagd/demo.flagd.json; then
72+ echo -e " ${RED} Error: Failed to download flagd configuration${NC} "
73+ exit 1
74+ fi
75+ echo -e " ${GREEN} ✓${NC} Downloaded flagd configuration"
6876
69- # Start containers
77+ # Download postgres init script
78+ if ! curl -fsSL " https://raw.githubusercontent.com/${GITHUB_REPO} /${BRANCH} /src/postgres/init.sql" -o src/postgres/init.sql; then
79+ echo -e " ${RED} Error: Failed to download postgres init script${NC} "
80+ exit 1
81+ fi
82+ echo -e " ${GREEN} ✓${NC} Downloaded postgres init script"
83+
84+ # Start containers with pull
7085echo " "
71- echo -e " ${YELLOW} →${NC} Starting containers..."
72- ${DOCKER_COMPOSE} -p " ${PROJECT_NAME} " up -d
86+ echo -e " ${YELLOW} →${NC} Pulling images and starting containers (this may take a few minutes)..."
87+
88+ if [[ " ${DOCKER_COMPOSE} " == " docker compose" ]]; then
89+ # Docker Compose v2 - use --pull always flag
90+ ${DOCKER_COMPOSE} -p " ${PROJECT_NAME} " up -d --pull always
91+ else
92+ # Docker Compose v1 - pull first, then up
93+ ${DOCKER_COMPOSE} -p " ${PROJECT_NAME} " pull
94+ ${DOCKER_COMPOSE} -p " ${PROJECT_NAME} " up -d
95+ fi
7396
7497# Check if containers are running
7598echo " "
0 commit comments