Files
wishlist/COOLIFY_DEPLOYMENT.md

85 lines
2.0 KiB
Markdown

# Coolify Deployment
## Prerequisites
- Coolify instance
- Git repository
## Database Setup
Choose one:
**Option A: Docker Compose (Recommended)**
- Database included in `docker-compose.coolify.yml`
- Skip to step 2
**Option B: Separate PostgreSQL Resource**
1. Create PostgreSQL database in Coolify
2. Note connection details
## Deploy
### Using Docker Compose (Recommended)
1. Create application in Coolify
2. Select Git repository
3. Configure:
- Build Pack: Docker Compose
- File: `./docker-compose.coolify.yml`
4. Assign domain to `app` service only (format: `http://yourdomain.com:3000`)
5. Set environment variables:
- `AUTH_SECRET` (generate with `openssl rand -base64 32`)
- `AUTH_URL` (your domain with https)
- `POSTGRES_DATA_PATH` (optional, for custom database storage location)
- `GOOGLE_CLIENT_ID` (optional)
- `GOOGLE_CLIENT_SECRET` (optional)
6. Deploy
### Using Dockerfile
1. Create application in Coolify
2. Select Git repository
3. Configure:
- Build Pack: Docker
- Port: `3000`
4. Add domain
5. Set environment variables:
- `DATABASE_URL`
- `AUTH_SECRET` (generate with `openssl rand -base64 32`)
- `AUTH_URL` (your domain with https)
- `GOOGLE_CLIENT_ID` (optional)
- `GOOGLE_CLIENT_SECRET` (optional)
6. Deploy
## After Deployment
Run migrations:
```bash
# In Coolify terminal or SSH
docker exec -it <container-name> bun run db:push
```
## Environment Variables
Required:
- `DATABASE_URL` - Connection string
- `AUTH_SECRET` - Random secret
- `AUTH_URL` - Your app URL
- `AUTH_TRUST_HOST` - `true`
Optional:
- `GOOGLE_CLIENT_ID`
- `GOOGLE_CLIENT_SECRET`
- `POSTGRES_DATA_PATH` - Custom path for PostgreSQL data (Docker Compose only)
- Example: `/mnt/storage/wishlist/postgres`
- If not set, uses a Docker named volume
- Path must exist with proper permissions before deployment
## Troubleshooting
**Container crashes:** Check logs in Coolify dashboard
**Database connection:** Verify `DATABASE_URL` format
**Auth issues:** Check `AUTH_URL` matches your domain