fix: clean up service configuration startup and development commands
This commit is contained in:
parent
4ddffa6b67
commit
805a9f8fd4
36 changed files with 627 additions and 596 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Trading Bot Docker Management Script
|
||||
set -euo pipefail
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
|
|
@ -79,18 +80,18 @@ fi
|
|||
|
||||
# Set up compose files
|
||||
if [ "$DEV" = true ]; then
|
||||
COMPOSE_FILES="-f docker-compose.yml -f docker-compose.dev.yml"
|
||||
COMPOSE_FILES=(-f docker-compose.yml -f docker-compose.dev.yml)
|
||||
else
|
||||
COMPOSE_FILES="-f docker-compose.yml"
|
||||
COMPOSE_FILES=(-f docker-compose.yml)
|
||||
fi
|
||||
|
||||
case "$ACTION" in
|
||||
"start")
|
||||
echo -e "${GREEN}🚀 Starting Trading Bot infrastructure...${NC}"
|
||||
if [ -n "$SERVICE" ]; then
|
||||
docker-compose $COMPOSE_FILES up -d "$SERVICE"
|
||||
docker compose "${COMPOSE_FILES[@]}" up -d "$SERVICE"
|
||||
else
|
||||
docker-compose $COMPOSE_FILES up -d dragonfly postgres questdb
|
||||
docker compose "${COMPOSE_FILES[@]}" up -d dragonfly postgres questdb mongodb
|
||||
fi
|
||||
echo -e "${GREEN}✅ Infrastructure started!${NC}"
|
||||
echo ""
|
||||
|
|
@ -105,9 +106,9 @@ case "$ACTION" in
|
|||
"stop")
|
||||
echo -e "${YELLOW}🛑 Stopping Trading Bot infrastructure...${NC}"
|
||||
if [ -n "$SERVICE" ]; then
|
||||
docker-compose $COMPOSE_FILES stop "$SERVICE"
|
||||
docker compose "${COMPOSE_FILES[@]}" stop "$SERVICE"
|
||||
else
|
||||
docker-compose $COMPOSE_FILES down
|
||||
docker compose "${COMPOSE_FILES[@]}" down
|
||||
fi
|
||||
echo -e "${GREEN}✅ Infrastructure stopped!${NC}"
|
||||
;;
|
||||
|
|
@ -115,16 +116,16 @@ case "$ACTION" in
|
|||
"restart")
|
||||
echo -e "${YELLOW}🔄 Restarting Trading Bot infrastructure...${NC}"
|
||||
if [ -n "$SERVICE" ]; then
|
||||
docker-compose $COMPOSE_FILES restart "$SERVICE"
|
||||
docker compose "${COMPOSE_FILES[@]}" restart "$SERVICE"
|
||||
else
|
||||
docker-compose $COMPOSE_FILES restart
|
||||
docker compose "${COMPOSE_FILES[@]}" restart
|
||||
fi
|
||||
echo -e "${GREEN}✅ Infrastructure restarted!${NC}"
|
||||
;;
|
||||
|
||||
"status")
|
||||
echo -e "${CYAN}📊 Trading Bot Infrastructure Status:${NC}"
|
||||
docker-compose $COMPOSE_FILES ps
|
||||
docker compose "${COMPOSE_FILES[@]}" ps
|
||||
echo ""
|
||||
echo -e "${CYAN}🔍 Health Checks:${NC}"
|
||||
docker ps --filter "name=trading-bot" --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
|
||||
|
|
@ -133,10 +134,10 @@ case "$ACTION" in
|
|||
"logs")
|
||||
if [ -n "$SERVICE" ]; then
|
||||
echo -e "${CYAN}📋 Logs for $SERVICE:${NC}"
|
||||
docker-compose $COMPOSE_FILES logs -f "$SERVICE"
|
||||
docker compose "${COMPOSE_FILES[@]}" logs -f "$SERVICE"
|
||||
else
|
||||
echo -e "${CYAN}📋 All service logs:${NC}"
|
||||
docker-compose $COMPOSE_FILES logs -f
|
||||
docker compose "${COMPOSE_FILES[@]}" logs -f
|
||||
fi
|
||||
;;
|
||||
|
||||
|
|
@ -144,9 +145,9 @@ case "$ACTION" in
|
|||
echo -e "${RED}⚠️ Resetting Trading Bot infrastructure (will delete all data)...${NC}"
|
||||
read -p "Are you sure? Type 'yes' to confirm: " confirm
|
||||
if [ "$confirm" = "yes" ]; then
|
||||
docker-compose $COMPOSE_FILES down -v
|
||||
docker compose "${COMPOSE_FILES[@]}" down -v
|
||||
echo -e "${YELLOW}🗑️ Volumes removed${NC}"
|
||||
docker-compose $COMPOSE_FILES up -d dragonfly postgres questdb
|
||||
docker compose "${COMPOSE_FILES[@]}" up -d dragonfly postgres questdb mongodb
|
||||
echo -e "${GREEN}✅ Infrastructure reset complete!${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}❌ Reset cancelled${NC}"
|
||||
|
|
@ -155,7 +156,7 @@ case "$ACTION" in
|
|||
|
||||
"admin")
|
||||
echo -e "${GREEN}🔧 Starting admin interfaces...${NC}"
|
||||
docker-compose $COMPOSE_FILES up -d redis-insight pgadmin
|
||||
docker compose "${COMPOSE_FILES[@]}" up -d redis-insight pgadmin
|
||||
echo -e "${GREEN}✅ Admin interfaces started!${NC}"
|
||||
echo ""
|
||||
echo -e "${CYAN}🔗 Admin Access:${NC}"
|
||||
|
|
@ -167,7 +168,7 @@ case "$ACTION" in
|
|||
|
||||
"monitoring")
|
||||
echo -e "${GREEN}📊 Starting monitoring stack...${NC}"
|
||||
docker-compose $COMPOSE_FILES up -d prometheus grafana loki
|
||||
docker compose "${COMPOSE_FILES[@]}" up -d prometheus grafana loki
|
||||
echo -e "${GREEN}✅ Monitoring started!${NC}"
|
||||
echo ""
|
||||
echo -e "${CYAN}🔗 Monitoring Access:${NC}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue