Files
picpeak/DEPLOYMENT.md
T
paul be07438915
Mirror to GitHub (Archive Method) / mirror (push) Failing after 16s
Mirror to GitHub (Rsync Method) / mirror (push) Failing after 16s
Mirror to GitHub / mirror (push) Failing after 16s
Test and Lint / backend-test (push) Successful in 1m10s
Test and Lint / frontend-test (push) Has started running
Version and Release / version-bump (push) Has been cancelled
Version and Release / trigger-drone (push) Has been cancelled
continuous-integration/drone/push Build is passing
docs: major repository restructure for GitHub public release
- Create comprehensive README.md optimized for GitHub/SEO
- Consolidate deployment instructions into single DEPLOYMENT.md
- Add all standard GitHub documentation files:
  - CONTRIBUTING.md with development guidelines
  - CODE_OF_CONDUCT.md for community standards
  - SECURITY.md with vulnerability reporting
  - CHANGELOG.md following Keep a Changelog format
- Simplify deployment with single docker-compose.yml
- Remove complex deployment configurations (Swarm, Traefik)
- Add backup script for easy maintenance
- Update .github-mirror-exclude to hide complex configs
- Remove redundant documentation files

This prepares PicPeak as a professional open-source alternative
to PicDrop and Scrapbook.de with clear, simple deployment.
2025-07-14 20:12:14 +02:00

4.6 KiB

🚀 PicPeak Deployment Guide

This guide will help you deploy PicPeak in production. The entire process takes about 10-15 minutes.

📋 Prerequisites

  • A server with Docker and Docker Compose installed
  • A domain name (for SSL certificates)
  • SMTP credentials for sending emails
  • Basic command line knowledge

1. Clone and Configure

# Clone the repository
git clone https://github.com/the-luap/picpeak.git
cd picpeak

# Copy environment template
cp .env.production.example .env

# Generate a secure JWT secret
echo "JWT_SECRET=$(openssl rand -base64 32)" >> .env

# Edit configuration
nano .env

2. Required Environment Variables

Edit your .env file with these essential settings:

# Application URLs
FRONTEND_URL=https://your-domain.com
BACKEND_URL=https://your-domain.com

# Email Configuration (Required for notifications)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password
SMTP_FROM=your-email@gmail.com

# Admin Configuration
ADMIN_EMAIL=admin@your-domain.com
ADMIN_PASSWORD=your-secure-password

# Database (PostgreSQL for production)
DATABASE_CLIENT=pg
DB_HOST=postgres
DB_NAME=picpeak
DB_USER=picpeak
DB_PASSWORD=secure-db-password

3. Deploy with Docker Compose

# Start all services
docker-compose -f docker-compose.prod.yml up -d

# Check logs
docker-compose logs -f

# Access your site at https://your-domain.com

🔧 Configuration Options

Storage Settings

# Storage paths (default: ./storage)
STORAGE_PATH=./storage
ARCHIVE_PATH=./storage/archives

# Gallery expiration (days)
DEFAULT_EXPIRATION_DAYS=30
WARNING_DAYS_BEFORE_EXPIRY=7

Security Settings

# Session timeout (minutes)
SESSION_TIMEOUT=60

# Rate limiting
RATE_LIMIT_WINDOW_MS=900000  # 15 minutes
RATE_LIMIT_MAX_REQUESTS=100

Analytics (Optional)

# Umami Analytics
VITE_UMAMI_URL=https://analytics.your-domain.com
VITE_UMAMI_WEBSITE_ID=your-website-id

🔒 SSL/TLS Setup

The production Docker Compose includes automatic SSL via Let's Encrypt:

  1. Ensure your domain points to your server
  2. Update nginx configuration:
    nano nginx/nginx.conf
    # Replace your-domain.com with your actual domain
    
  3. Start services - Certbot will automatically obtain certificates

📁 Directory Structure

After deployment, your directory structure will be:

picpeak/
├── backend/          # API server
├── frontend/         # React app
├── storage/          # Photo storage
│   ├── events/       # Active galleries
│   │   ├── active/   # Current photos
│   │   └── archived/ # Expired galleries
│   ├── thumbnails/   # Generated thumbnails
│   └── uploads/      # User uploads
├── data/            # Database files
└── logs/            # Application logs

🔄 Maintenance

Backup

# Backup database and photos
./scripts/backup.sh

# Backups are stored in ./backups/

Update

# Pull latest changes
git pull

# Rebuild and restart
docker-compose -f docker-compose.prod.yml up -d --build

Logs

# View all logs
docker-compose logs

# View specific service
docker-compose logs backend
docker-compose logs frontend

🚨 Troubleshooting

Common Issues

Photos not appearing:

  • Check storage permissions: chmod -R 755 storage/
  • Verify file watcher is running: docker-compose logs backend | grep watcher

Email not sending:

  • Test SMTP settings: Admin Panel → Settings → Email → Send Test
  • Check email queue: Admin Panel → System → Email Queue

Can't access admin panel:

  • Default login: Use email/password from .env
  • Reset password: docker exec picpeak-backend npm run reset-admin

Health Check

# Check service status
docker-compose ps

# Test backend API
curl https://your-domain.com/api/health

# Check disk space
df -h storage/

🐳 Alternative Deployment Methods

Using Docker Swarm

For high availability deployments, see Docker Swarm Setup.

Manual Installation

If you prefer not to use Docker:

  1. Install Node.js 18+
  2. Install PostgreSQL
  3. Clone repository
  4. Install dependencies: npm install in both /backend and /frontend
  5. Build frontend: cd frontend && npm run build
  6. Start services with PM2

📞 Support


Need help? Open an issue on GitHub and we'll assist you!