- Add Dockerfile with multi-stage build (Node.js + Nginx) - Add docker-compose.yml for Portainer stack deployment on port 7777 - Add nginx.conf with PWA support, gzip compression, and security headers - Add .dockerignore for optimized Docker builds - Add DEPLOYMENT.md with comprehensive deployment guide - Configure Vite PWA plugin with service worker and offline support - Add PWA manifest.json with app icons and shortcuts - Enhance logo.svg with iOS-style glass effects (filters, gradients, highlights) - Add app-icon.svg for PWA installation - Update mobile nav with glassmorphic active tab styling - Fix mobile tab bar layout shift issues with flex-1 and consistent sizing - Update index.html with PWA meta tags and Apple-specific settings - Add health check endpoint at /health for container monitoring Co-authored-by: Cursor <cursoragent@cursor.com>
175 lines
3.2 KiB
Markdown
175 lines
3.2 KiB
Markdown
# IndeedHub - Portainer Deployment Guide
|
|
|
|
## Quick Deploy with Portainer Stacks
|
|
|
|
### Method 1: Using Portainer Stacks (Recommended)
|
|
|
|
1. **Log into Portainer**
|
|
2. **Navigate to Stacks**
|
|
3. **Click "Add Stack"**
|
|
4. **Choose "Git Repository"** or **"Upload"** the `docker-compose.yml`
|
|
5. **Configure:**
|
|
- Name: `indeedhub-prototype`
|
|
- Repository URL: (your git repo)
|
|
- Compose path: `docker-compose.yml`
|
|
6. **Deploy**
|
|
|
|
### Method 2: Using Docker Compose Directly
|
|
|
|
```bash
|
|
# Build and run
|
|
docker-compose up -d --build
|
|
|
|
# View logs
|
|
docker-compose logs -f
|
|
|
|
# Stop
|
|
docker-compose down
|
|
```
|
|
|
|
## Access
|
|
|
|
- **Application URL**: `http://your-server:7777`
|
|
- **Health Check**: `http://your-server:7777/health`
|
|
|
|
## Configuration
|
|
|
|
### Port Configuration
|
|
The application runs on port **7777** by default. To change:
|
|
|
|
```yaml
|
|
# In docker-compose.yml
|
|
ports:
|
|
- "YOUR_PORT:7777"
|
|
```
|
|
|
|
### Environment Variables
|
|
Add any required environment variables in `docker-compose.yml`:
|
|
|
|
```yaml
|
|
environment:
|
|
- NODE_ENV=production
|
|
- VITE_API_URL=https://your-api.com
|
|
```
|
|
|
|
## Build Details
|
|
|
|
### Multi-stage Docker Build
|
|
1. **Builder Stage**: Compiles Vue/TypeScript application
|
|
2. **Production Stage**: Serves built files with Nginx
|
|
|
|
### Features
|
|
- ✅ Nginx web server (Alpine Linux)
|
|
- ✅ Gzip compression
|
|
- ✅ Security headers
|
|
- ✅ PWA support with proper MIME types
|
|
- ✅ Vue Router SPA fallback
|
|
- ✅ Service Worker support
|
|
- ✅ Health check endpoint
|
|
- ✅ Auto-restart enabled
|
|
|
|
## Monitoring
|
|
|
|
### Health Check
|
|
```bash
|
|
curl http://localhost:7777/health
|
|
```
|
|
|
|
### Container Status
|
|
```bash
|
|
docker ps | grep indeedhub
|
|
```
|
|
|
|
### View Logs
|
|
```bash
|
|
docker logs -f indeedhub-app
|
|
```
|
|
|
|
## Updates
|
|
|
|
### Rebuild and Deploy
|
|
```bash
|
|
docker-compose down
|
|
docker-compose up -d --build
|
|
```
|
|
|
|
### Using Portainer
|
|
1. Go to your stack
|
|
2. Click "Update"
|
|
3. Enable "Pull latest image"
|
|
4. Click "Update the stack"
|
|
|
|
## Troubleshooting
|
|
|
|
### Container won't start
|
|
```bash
|
|
# Check logs
|
|
docker logs indeedhub-app
|
|
|
|
# Check if port is available
|
|
lsof -i :7777
|
|
```
|
|
|
|
### Build fails
|
|
```bash
|
|
# Clear Docker cache
|
|
docker builder prune
|
|
|
|
# Rebuild without cache
|
|
docker-compose build --no-cache
|
|
```
|
|
|
|
## Production Checklist
|
|
|
|
- ✅ Port 7777 exposed
|
|
- ✅ Health checks configured
|
|
- ✅ Auto-restart enabled
|
|
- ✅ Gzip compression enabled
|
|
- ✅ Security headers set
|
|
- ✅ PWA manifest support
|
|
- ✅ Service worker caching
|
|
- ✅ SPA routing configured
|
|
- ✅ Docker networking isolated
|
|
|
|
## Stack Configuration for Portainer
|
|
|
|
Copy this into Portainer Stack editor:
|
|
|
|
```yaml
|
|
version: '3.8'
|
|
|
|
services:
|
|
indeedhub:
|
|
image: indeedhub-prototype:latest
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: indeedhub-app
|
|
restart: unless-stopped
|
|
ports:
|
|
- "7777:7777"
|
|
environment:
|
|
- NODE_ENV=production
|
|
networks:
|
|
- indeedhub-network
|
|
labels:
|
|
- "com.centurylinklabs.watchtower.enable=true"
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:7777/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
networks:
|
|
indeedhub-network:
|
|
driver: bridge
|
|
```
|
|
|
|
## Support
|
|
|
|
For issues, check:
|
|
1. Container logs: `docker logs indeedhub-app`
|
|
2. Health endpoint: `http://localhost:7777/health`
|
|
3. Nginx config: `/etc/nginx/conf.d/default.conf`
|