Skip to content

Latest commit

 

History

History
136 lines (97 loc) · 2.43 KB

File metadata and controls

136 lines (97 loc) · 2.43 KB

Docker Quick Start - Server Without Node.js

What You Need

On Server:

  • ✅ Docker installed (that's it! No Node.js needed)

On Your Computer:

  • ✅ Docker installed (for testing locally)

Quick Deploy (5 Steps)

1. Transfer Files to Server

# Option A: Using Git (recommended)
git push
# Then on server: git pull

# Option B: Using rsync
rsync -avz --exclude 'node_modules' --exclude '.next' . user@server:/app/reda

2. Create .env File on Server

ssh user@your-server
cd /app/reda
nano .env

Add these variables:

NEXT_PUBLIC_SUPABASE_URL=https://zyfzkfvzrlaotdraxmjw.supabase.co
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY=sb_publishable_MFcNhrLrO866XKREOCnrlA_zZ7Poxnc
SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
DATABASE_URL=postgresql://postgres.zyfzkfvzrlaotdraxmjw:yZL1tNObGOktwuH8@aws-1-eu-central-1.pooler.supabase.com:6543/postgres?pgbouncer=true
DIRECT_URL=postgresql://postgres.zyfzkfvzrlaotdraxmjw:yZL1tNObGOktwuH8@aws-1-eu-central-1.pooler.supabase.com:5432/postgres
NODE_ENV=production
PORT=3000

3. Build and Start

docker-compose up -d --build

4. Check Status

docker-compose ps
docker-compose logs -f

5. Access Your App

Open: http://your-server-ip:3000


Common Commands

# View logs
docker-compose logs -f

# Stop app
docker-compose down

# Restart app
docker-compose restart

# Update app (after code changes)
git pull
docker-compose up -d --build

# Check if running
docker-compose ps

Testing Locally (Before Deploying)

# Build image
docker-compose build

# Start container
docker-compose up

# Access at http://localhost:3000

Troubleshooting

Container won't start?

docker-compose logs

Port already in use?

# Change port in docker-compose.yml: "8080:3000"
# Then access at http://localhost:8080

Need to rebuild?

docker-compose down
docker-compose build --no-cache
docker-compose up -d

Files Created

  • Dockerfile - Container definition
  • docker-compose.yml - Easy deployment
  • .dockerignore - Exclude unnecessary files
  • deploy.sh - Automated deployment script
  • next.config.ts - Updated with output: 'standalone'

Full Documentation

See DEPLOY_NO_NODE.md for complete guide including:

  • Nginx reverse proxy setup
  • SSL/HTTPS configuration
  • Production optimizations
  • Detailed troubleshooting