changes
This commit is contained in:
18
Makefile
18
Makefile
@ -44,6 +44,9 @@ rebuild:
|
||||
$(DOCKER_COMPOSE) up --build -d
|
||||
@$(MAKE) wait
|
||||
|
||||
preload:
|
||||
@docker exec -it $$(docker ps -qf "name=$(PROJECT_NAME)-web") flask preload-data
|
||||
|
||||
logs:
|
||||
$(DOCKER_COMPOSE) logs -f
|
||||
|
||||
@ -77,7 +80,14 @@ test:
|
||||
|
||||
wait:
|
||||
@echo "[⏳] Waiting for web container to be healthy..."
|
||||
@until [ "$$(docker inspect -f '{{.State.Health.Status}}' $(PROJECT_NAME)-web-1 2>/dev/null)" = "healthy" ]; do \
|
||||
printf "."; sleep 2; \
|
||||
done
|
||||
@echo "\n[✅] Web container is healthy!"
|
||||
@timeout 90 bash -c '\
|
||||
WEB_CONTAINER=$$($(DOCKER_COMPOSE) ps -q web); \
|
||||
if [ -z "$$WEB_CONTAINER" ]; then \
|
||||
echo "[❌] Could not detect web container!"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
echo "[ℹ] Detected container: $$WEB_CONTAINER"; \
|
||||
while [ "$$(docker inspect -f "{{.State.Health.Status}}" $$WEB_CONTAINER 2>/dev/null)" != "healthy" ]; do \
|
||||
sleep 2; echo -n "."; \
|
||||
done; echo "\n[✅] $$WEB_CONTAINER is healthy!"'
|
||||
|
||||
|
Reference in New Issue
Block a user