-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
137 lines (119 loc) · 2.91 KB
/
run.sh
File metadata and controls
137 lines (119 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/bash
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NC='\033[0m'
# Print banner
echo -e "${BLUE}"
echo "================================================"
echo " NFT Bidding Bot Installer "
echo "================================================"
echo -e "${NC}"
# Check if Docker is installed
if ! command -v docker &> /dev/null; then
echo -e "${RED}Docker is not installed. Please install Docker first.${NC}"
exit 1
fi
# Create docker-compose.yml
cat > docker-compose.yml << 'EOL'
services:
server:
build:
context: ./server
dockerfile: Dockerfile
restart: always
ports:
- "3003:3003"
env_file:
- .env
environment:
PORT: 3003
depends_on:
- mongodb
- redis
networks:
- nft_network
client:
build:
context: ./client
dockerfile: Dockerfile
restart: always
ports:
- "3001:3001"
env_file:
- .env
environment:
PORT: 3001
NEXT_PUBLIC_SERVER_WEBSOCKET: "ws://localhost:3003"
depends_on:
- mongodb
- server
- redis
networks:
- nft_network
mongodb:
image: mongo:latest
restart: unless-stopped
volumes:
- mongodb_data:/data/db
networks:
- nft_network
redis:
image: redis:latest
restart: unless-stopped
volumes:
- redis_data:/data
networks:
- nft_network
volumes:
mongodb_data:
redis_data:
networks:
nft_network:
driver: bridge
EOL
# Create .env file
cat > .env << EOL
# Required API Keys
ALCHEMY_API_KEY=${ALCHEMY_API_KEY:-""}
# Database Configuration
MONGODB_URI=mongodb://mongodb:27017/nftbot
REDIS_URI=redis://redis:6379
# Authentication
JWT_SECRET=${JWT_SECRET:-"your-secret-key"}
# Email Configuration
EMAIL_USERNAME=${EMAIL_USERNAME:-""}
EMAIL_PASSWORD=${EMAIL_PASSWORD:-""}
# URLs
CLIENT_URL=http://localhost:3001
NEXT_PUBLIC_CLIENT_URL=http://localhost:3001
NEXT_PUBLIC_SERVER_WEBSOCKET=ws://localhost:3003
EOL
# Clone repositories
echo -e "${BLUE}Cloning repositories...${NC}"
git clone https://github.com/NFTToolz/BiddingBot-Server.git server
git clone https://github.com/NFTToolz/BiddingBot.git client
# Start the application
echo -e "${BLUE}Starting the application...${NC}"
docker compose up -d --build
# Wait for services to be ready
echo -e "${BLUE}Waiting for services to start...${NC}"
sleep 10
# Check if services are running
if docker compose ps | grep -q "running"; then
echo -e "${GREEN}"
echo "================================================"
echo "NFT Bidding Bot is now running!"
echo "Open your browser and navigate to:"
echo "http://localhost:3001"
echo ""
echo "To stop the application, run:"
echo "docker compose down"
echo "================================================"
echo -e "${NC}"
else
echo -e "${RED}Error: Services failed to start properly${NC}"
docker compose logs
exit 1
fi