-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-production.sh
More file actions
executable file
·42 lines (33 loc) · 1.33 KB
/
Copy pathtest-production.sh
File metadata and controls
executable file
·42 lines (33 loc) · 1.33 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
#!/bin/bash
# Colors for output
GREEN='\033[0;32m'
BLUE='\033[0;34m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
echo -e "${BLUE}========================================${NC}"
echo -e "${BLUE}Testing Production Build Locally${NC}"
echo -e "${BLUE}(Without Docker)${NC}"
echo -e "${BLUE}========================================${NC}\n"
# Step 1: Build the Next.js app
echo -e "${YELLOW}Step 1: Building Next.js application...${NC}"
npm run build
if [ $? -ne 0 ]; then
echo -e "${RED}❌ Build failed!${NC}"
exit 1
fi
echo -e "${GREEN}✅ Build successful${NC}\n"
# Step 2: Start the production server
echo -e "${YELLOW}Step 2: Starting production server on port 8080...${NC}"
echo -e "${BLUE}Setting environment variables...${NC}"
export PORT=8080
export NODE_ENV=production
export NEXT_PUBLIC_FIREBASE_API_KEY="AIzaSyCV3GKEETe2OgqyyL72gqUOHAQJq6D5CAg"
export NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN="direct-byte-473415-t7.firebaseapp.com"
export NEXT_PUBLIC_FIREBASE_PROJECT_ID="direct-byte-473415-t7"
export NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET="direct-byte-473415-t7.firebasestorage.app"
export NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID="821415399811"
export NEXT_PUBLIC_FIREBASE_APP_ID="1:821415399811:web:aed3be6e6b4d00009066b6"
echo -e "${GREEN}✅ Environment configured${NC}\n"
echo -e "${BLUE}Starting server...${NC}\n"
npm start