- SEC filings extraction (10-K, 10-Q, 8-K) - Portfolio analytics with real-time prices - Watchlist management - NextAuth.js authentication - OpenClaw AI integration - PostgreSQL database with auto P&L calculations - Elysia.js backend (Bun runtime) - Next.js 14 frontend (TailwindCSS + Recharts) - Production-ready Docker configurations
102 lines
2.2 KiB
Markdown
102 lines
2.2 KiB
Markdown
# Coolify Deployment Guide
|
|
|
|
This project is ready for deployment on Coolify.
|
|
|
|
## Prerequisites
|
|
|
|
1. Coolify instance running
|
|
2. GitHub repository with this code
|
|
3. PostgreSQL database
|
|
|
|
## Deployment Steps
|
|
|
|
### Option 1: Single Docker Compose App
|
|
|
|
1. Create a new Docker Compose application in Coolify
|
|
2. Connect your GitHub repository
|
|
3. Select the `docker-compose.yml` file in the root
|
|
4. Configure environment variables:
|
|
|
|
```
|
|
DATABASE_URL=postgres://postgres:your_password@postgres:5432/fiscal
|
|
POSTGRES_USER=postgres
|
|
POSTGRES_PASSWORD=your_password
|
|
POSTGRES_DB=fiscal
|
|
PORT=3001
|
|
NEXT_PUBLIC_API_URL=https://your-fiscal-domain.com
|
|
```
|
|
|
|
5. Deploy
|
|
|
|
### Option 2: Separate Applications
|
|
|
|
#### Backend
|
|
|
|
1. Create a new application in Coolify
|
|
2. Source: GitHub
|
|
3. Branch: `main`
|
|
4. Build Context: `/backend`
|
|
5. Build Pack: `Dockerfile`
|
|
6. Environment Variables:
|
|
```
|
|
DATABASE_URL=postgres://...
|
|
PORT=3001
|
|
```
|
|
7. Deploy
|
|
|
|
#### Frontend
|
|
|
|
1. Create a new application in Coolify
|
|
2. Source: GitHub
|
|
3. Branch: `main`
|
|
4. Build Context: `/frontend`
|
|
5. Build Pack: `Dockerfile`
|
|
6. Environment Variables:
|
|
```
|
|
NEXT_PUBLIC_API_URL=https://your-backend-domain.com
|
|
```
|
|
7. Deploy
|
|
|
|
## Environment Variables
|
|
|
|
### Backend
|
|
- `DATABASE_URL` - PostgreSQL connection string
|
|
- `PORT` - Server port (default: 3001)
|
|
- `NODE_ENV` - Environment (development/production)
|
|
|
|
### Frontend
|
|
- `NEXT_PUBLIC_API_URL` - Backend API URL
|
|
|
|
## Database Setup
|
|
|
|
The application will automatically create the database schema on startup. To manually run migrations:
|
|
|
|
```bash
|
|
docker exec -it <backend_container> bun run db:migrate
|
|
```
|
|
|
|
## Monitoring
|
|
|
|
Once deployed, add the application to OpenClaw's monitoring:
|
|
|
|
1. Add to `/data/workspace/memory/coolify-integration.md`
|
|
2. Set up Discord alerts for critical issues
|
|
3. Configure cron jobs for health checks
|
|
|
|
## Troubleshooting
|
|
|
|
### Database Connection Failed
|
|
- Check DATABASE_URL is correct
|
|
- Ensure PostgreSQL container is running
|
|
- Verify network connectivity
|
|
|
|
### Frontend Can't Connect to Backend
|
|
- Verify NEXT_PUBLIC_API_URL points to backend
|
|
- Check CORS settings in backend
|
|
- Ensure both containers are on same network
|
|
|
|
### Cron Jobs Not Running
|
|
- Check Elysia cron configuration
|
|
- Verify timezone settings
|
|
- Check logs for errors
|