Add deployment scripts and Easypanel guide
This commit is contained in:
150
EASYPANEL-SETUP.md
Normal file
150
EASYPANEL-SETUP.md
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
# Easypanel Deployment Guide - MoreminiMore Website
|
||||||
|
|
||||||
|
## Quick Deploy
|
||||||
|
|
||||||
|
### Option 1: Run Deploy Script
|
||||||
|
```bash
|
||||||
|
cd moreminimore-redesign
|
||||||
|
./deploy.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Option 2: Manual Deployment
|
||||||
|
|
||||||
|
## Step-by-Step Manual Deployment
|
||||||
|
|
||||||
|
### Step 1: Login to Easypanel
|
||||||
|
|
||||||
|
Navigate to your Easypanel instance and login.
|
||||||
|
|
||||||
|
### Step 2: Create Project (if needed)
|
||||||
|
|
||||||
|
1. Click **"New Project"**
|
||||||
|
2. Enter project name: `moreminimore-website`
|
||||||
|
3. Click **"Create Project"**
|
||||||
|
|
||||||
|
### Step 3: Add Service
|
||||||
|
|
||||||
|
1. Click **"New Service"** in your project
|
||||||
|
2. Select **"Git Repository"**
|
||||||
|
|
||||||
|
### Step 4: Configure Git Repository
|
||||||
|
|
||||||
|
Fill in the following:
|
||||||
|
|
||||||
|
| Field | Value |
|
||||||
|
|-------|-------|
|
||||||
|
| **Name** | `moreminimore-website` |
|
||||||
|
| **Repository URL** | `https://git.moreminimore.com/kunthawat/moreminimore-website.git` |
|
||||||
|
| **Branch** | `main` |
|
||||||
|
| **Username** | (your Gitea username) |
|
||||||
|
| **Password/Token** | (your Gitea password or token) |
|
||||||
|
|
||||||
|
### Step 5: Configure Docker
|
||||||
|
|
||||||
|
| Field | Value |
|
||||||
|
|-------|-------|
|
||||||
|
| **Dockerfile** | `Dockerfile` (default) |
|
||||||
|
| **Port** | `4321` |
|
||||||
|
| **Command** | `npx astro preview --host 0.0.0.0 --port 4321` |
|
||||||
|
|
||||||
|
### Step 6: Enable Auto-Deploy
|
||||||
|
|
||||||
|
1. Go to **Settings** → **Deploy**
|
||||||
|
2. Find **"Auto Deploy"** section
|
||||||
|
3. Toggle to **Enabled**
|
||||||
|
4. Select branch: `main`
|
||||||
|
5. Click **"Save"**
|
||||||
|
|
||||||
|
### Step 7: Deploy
|
||||||
|
|
||||||
|
1. Go to **Deployments** tab
|
||||||
|
2. Click **"Deploy Now"** (or wait for auto-deploy on next push)
|
||||||
|
3. Watch the build logs
|
||||||
|
4. Wait for deployment to complete (~2-3 minutes)
|
||||||
|
|
||||||
|
### Step 8: Verify
|
||||||
|
|
||||||
|
1. Click the service URL (provided by Easypanel)
|
||||||
|
2. Verify homepage loads
|
||||||
|
3. Test navigation and all pages
|
||||||
|
|
||||||
|
## Environment Variables
|
||||||
|
|
||||||
|
No environment variables required (static site).
|
||||||
|
|
||||||
|
## SSL/HTTPS
|
||||||
|
|
||||||
|
Easypanel automatically provisions SSL certificates. Your site will be available at:
|
||||||
|
- `https://your-service.your-project.easypanel.app`
|
||||||
|
|
||||||
|
## Custom Domain (Optional)
|
||||||
|
|
||||||
|
To use custom domain:
|
||||||
|
|
||||||
|
1. Go to **Settings** → **Domains**
|
||||||
|
2. Add your domain: `www.moreminimore.com`
|
||||||
|
3. Update DNS records as instructed
|
||||||
|
4. Wait for SSL certificate (5-10 minutes)
|
||||||
|
|
||||||
|
## Troubleshooting
|
||||||
|
|
||||||
|
### Build Fails
|
||||||
|
|
||||||
|
1. Check **Deployments** → **Build Logs**
|
||||||
|
2. Common issues:
|
||||||
|
- Missing dependencies → Check `package.json`
|
||||||
|
- Build errors → Check TypeScript/Astro errors
|
||||||
|
- Docker issues → Check `Dockerfile`
|
||||||
|
|
||||||
|
### Site Not Loading
|
||||||
|
|
||||||
|
1. Check if container is running (Easypanel dashboard)
|
||||||
|
2. Check container logs
|
||||||
|
3. Verify port 4321 is exposed
|
||||||
|
4. Check firewall/network settings
|
||||||
|
|
||||||
|
### Auto-Deploy Not Working
|
||||||
|
|
||||||
|
1. Verify auto-deploy is enabled
|
||||||
|
2. Check webhook configuration in Gitea
|
||||||
|
3. Manual trigger: Click **"Deploy Now"**
|
||||||
|
|
||||||
|
## Update Deployment
|
||||||
|
|
||||||
|
After initial setup, updates are automatic:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Make changes
|
||||||
|
cd moreminimore-redesign
|
||||||
|
|
||||||
|
# Commit and push
|
||||||
|
git add .
|
||||||
|
git commit -m "Update: [description]"
|
||||||
|
git push origin main
|
||||||
|
|
||||||
|
# Easypanel auto-deploys within 1-2 minutes
|
||||||
|
```
|
||||||
|
|
||||||
|
## Rollback
|
||||||
|
|
||||||
|
To rollback to previous version:
|
||||||
|
|
||||||
|
1. Go to **Deployments** tab
|
||||||
|
2. Find previous successful deployment
|
||||||
|
3. Click **"Redeploy"** on that version
|
||||||
|
|
||||||
|
## Monitoring
|
||||||
|
|
||||||
|
- **Logs**: Easypanel → Service → Logs
|
||||||
|
- **Deployments**: Easypanel → Service → Deployments
|
||||||
|
- **Resource Usage**: Easypanel → Service → Metrics
|
||||||
|
|
||||||
|
## Support
|
||||||
|
|
||||||
|
For Easypanel-specific issues:
|
||||||
|
- Documentation: https://easypanel.io/docs
|
||||||
|
- Discord: https://discord.gg/9bcDSXcZQ7
|
||||||
|
|
||||||
|
For this project:
|
||||||
|
- Check `DEPLOYMENT.md`
|
||||||
|
- Check `CHECKLIST.md`
|
||||||
103
deploy.sh
Executable file
103
deploy.sh
Executable file
@@ -0,0 +1,103 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Easypanel Deployment Script for MoreminiMore Redesign
|
||||||
|
# This script helps deploy to Easypanel
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Configuration
|
||||||
|
GITEA_URL="https://git.moreminimore.com/kunthawat/moreminimore-website.git"
|
||||||
|
DOCKERFILE_PATH="Dockerfile"
|
||||||
|
CONTAINER_PORT=4321
|
||||||
|
PROJECT_NAME="moreminimore-website"
|
||||||
|
|
||||||
|
echo "=========================================="
|
||||||
|
echo "MoreminiMore Redesign - Easypanel Deploy"
|
||||||
|
echo "=========================================="
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
# Step 1: Check if Docker is installed
|
||||||
|
echo "Step 1: Checking Docker..."
|
||||||
|
if command -v docker &> /dev/null; then
|
||||||
|
echo "✓ Docker is installed"
|
||||||
|
docker --version
|
||||||
|
else
|
||||||
|
echo "✗ Docker is not installed"
|
||||||
|
echo "Please install Docker Desktop: https://www.docker.com/products/docker-desktop/"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Step 2: Build Docker image locally (test)
|
||||||
|
echo ""
|
||||||
|
echo "Step 2: Building Docker image locally..."
|
||||||
|
cd moreminimore-redesign
|
||||||
|
docker build -t moreminimore-redesign:latest .
|
||||||
|
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "✓ Docker build successful"
|
||||||
|
else
|
||||||
|
echo "✗ Docker build failed"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Step 3: Test locally
|
||||||
|
echo ""
|
||||||
|
echo "Step 3: Testing locally (optional)..."
|
||||||
|
echo "To test locally, run:"
|
||||||
|
echo " docker run -p 4321:4321 moreminimore-redesign:latest"
|
||||||
|
echo "Then visit: http://localhost:4321"
|
||||||
|
echo ""
|
||||||
|
read -p "Skip local test and continue? (y/n) " -n 1 -r
|
||||||
|
echo
|
||||||
|
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||||
|
docker run -p 4321:4321 moreminimore-redesign:latest &
|
||||||
|
echo "Server started. Press Ctrl+C to stop and continue deployment."
|
||||||
|
wait
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Step 4: Push to Gitea
|
||||||
|
echo ""
|
||||||
|
echo "Step 4: Pushing to Gitea..."
|
||||||
|
git add .
|
||||||
|
git commit -m "Deploy: $(date '+%Y-%m-%d %H:%M:%S')" || echo "No changes to commit"
|
||||||
|
git push origin main
|
||||||
|
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo "✓ Code pushed to Gitea"
|
||||||
|
else
|
||||||
|
echo "✗ Failed to push to Gitea"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Step 5: Easypanel Instructions
|
||||||
|
echo ""
|
||||||
|
echo "=========================================="
|
||||||
|
echo "Step 5: Configure Easypanel"
|
||||||
|
echo "=========================================="
|
||||||
|
echo ""
|
||||||
|
echo "Manual Steps Required:"
|
||||||
|
echo ""
|
||||||
|
echo "1. Login to your Easypanel instance"
|
||||||
|
echo ""
|
||||||
|
echo "2. Create or select project:"
|
||||||
|
echo " - Project Name: moreminimore-website"
|
||||||
|
echo ""
|
||||||
|
echo "3. Add New Service:"
|
||||||
|
echo " - Type: Git Repository"
|
||||||
|
echo " - Repository URL: $GITEA_URL"
|
||||||
|
echo " - Branch: main"
|
||||||
|
echo ""
|
||||||
|
echo "4. Configure Docker:"
|
||||||
|
echo " - Dockerfile: $DOCKERFILE_PATH"
|
||||||
|
echo " - Port: $CONTAINER_PORT"
|
||||||
|
echo ""
|
||||||
|
echo "5. Enable Auto-Deploy:"
|
||||||
|
echo " - Settings → Auto-deploy → Enable"
|
||||||
|
echo " - Branch: main"
|
||||||
|
echo ""
|
||||||
|
echo "6. Deploy!"
|
||||||
|
echo " - Easypanel will build and deploy automatically"
|
||||||
|
echo ""
|
||||||
|
echo "=========================================="
|
||||||
|
echo "Deployment script completed!"
|
||||||
|
echo "=========================================="
|
||||||
Reference in New Issue
Block a user