2.7 KiB
2.7 KiB
Manual Deployment Instructions
Quick Deployment to Dev Server
Since Git authentication is having issues, here's the manual deployment process:
Step 1: Create Deployment Package (On Your Local Machine)
# Create archive excluding unnecessary files
tar -czf sdi-deploy.tar.gz \
--exclude='node_modules' \
--exclude='.git' \
--exclude='dist' \
--exclude='*.log' \
.
Step 2: Upload to Server
# Upload the archive
scp sdi-deploy.tar.gz root@102.69.243.165:/tmp/
Password: clonii@@2014
Step 3: Deploy on Server
SSH into the server:
ssh root@102.69.243.165
Then run these commands:
# Create deployment directory
mkdir -p /var/www/sdi-saas
cd /var/www/sdi-saas
# Extract files
tar -xzf /tmp/sdi-deploy.tar.gz
# Install Node.js 20 (if not installed)
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
# Install pnpm
npm install -g pnpm@8.15.0
# Install dependencies
pnpm install
# Set up environment files
cp apps/api/.env.example apps/api/.env
cp apps/worker/.env.example apps/worker/.env
cp packages/database/.env.example packages/database/.env
# Update DATABASE_URL for Docker networking
sed -i 's/localhost/postgres/g' apps/api/.env
sed -i 's/localhost/postgres/g' apps/worker/.env
sed -i 's/localhost/postgres/g' packages/database/.env
# Generate Prisma client
cd packages/database
pnpm db:generate
# Start Docker services
cd /var/www/sdi-saas
docker-compose up -d
# Wait for database to be ready
sleep 15
# Run migrations
cd packages/database
pnpm db:migrate
# Seed demo data
pnpm db:seed
# Check services are running
cd /var/www/sdi-saas
docker-compose ps
Step 4: Verify Deployment
Access the API:
- API: http://102.69.243.165:3000
- API Docs: http://102.69.243.165:3000/api/docs
Check logs:
docker-compose logs -f
Alternative: Git Push (If Authentication Works)
If you can fix the Git authentication issue:
# On local machine
git remote set-url origin https://git.votcloud.com/austindebest/sdi.git
git push -u origin main
# Enter username: austindebest
# Enter password: VcG_3xwbEUyDcMqgKwTTLJP4KoEp!Q9
# On server
cd /var/www
git clone https://git.votcloud.com/austindebest/sdi.git sdi-saas
cd sdi-saas
# Follow deployment steps above
For Future Updates
# Create new deployment package
tar -czf sdi-deploy.tar.gz --exclude='node_modules' --exclude='.git' --exclude='dist' .
# Upload
scp sdi-deploy.tar.gz root@102.69.243.165:/tmp/
# SSH and update
ssh root@102.69.243.165
cd /var/www/sdi-saas
tar -xzf /tmp/sdi-deploy.tar.gz
pnpm install
cd packages/database && pnpm db:generate
cd /var/www/sdi-saas
docker-compose up -d --build
Ready to proceed with Phase 1 development once deployed!