- Fixed nginx 404 errors with enhanced file copying and fallback configuration - Added docker-compose.simple.yml for streamlined first-time deployment - Enhanced docker-compose.deploy-local.yml with detailed debugging and health checks - Improved nginx.deploy.conf with fallback pages and auto-refresh - Added comprehensive DEPLOYMENT_GUIDE.md with multiple deployment options - Created validate-deployment.sh script for environment validation - Updated container interface deployment documentation - Added DEPLOYMENT_STATUS.md summary of ready features Deployment improvements: - Enhanced container startup sequence with health checks - Detailed logging for troubleshooting file copying issues - Multiple deployment strategies for different use cases - Fallback nginx configuration prevents 404 errors during startup - Auto-refresh functionality for seamless user experience Ready for production deployment via container interfaces or command line.
6.5 KiB
🚀 Etsy Finance Tracker - Deployment Guide
Quick Start for Container Interfaces (Docker Desktop, Portainer, etc.)
Option 1: Local Build Deployment (Recommended)
File to Use: docker-compose.deploy-local.yml
This option builds the containers locally and includes enhanced debugging.
Steps:
-
Import Configuration
- In Docker Desktop: Click "+" → "Import" → Select
docker-compose.deploy-local.yml - In Portainer: Go to "Stacks" → "Add stack" → Upload
docker-compose.deploy-local.yml
- In Docker Desktop: Click "+" → "Import" → Select
-
Configure Environment
- Set Stack Name:
etsy-finance-tracker-local - Environment Variables (optional):
NODE_ENV=production PORT=8080
- Set Stack Name:
-
Deploy Stack
- Click "Deploy" or "Create Stack"
- Wait for both containers to build and start
-
Access Application
- Frontend: http://localhost:8081
- API: http://localhost:8081/api
- Health Check: http://localhost:8081/api/health
Troubleshooting Tips:
- 404 Errors: Check container logs for file copying messages
- Build Failures: Ensure you have sufficient disk space (>2GB recommended)
- Port Conflicts: Change port 8081 to another available port
Option 2: Pre-built Images (GitHub Container Registry)
File to Use: docker-compose.deploy.yml
This uses pre-built images from GitHub Container Registry.
Prerequisites:
- Must have pulled images manually or have registry access
Steps:
-
Pull Images First (if needed):
docker pull ghcr.io/your-username/etsy-finance-tracker:latest -
Import Configuration
- Use
docker-compose.deploy.ymlin your container interface - Set Stack Name:
etsy-finance-tracker
- Use
-
Deploy and Access
- Same as Option 1
Container Architecture
┌─────────────────────────────────────┐
│ nginx (Port 8081) │
│ ┌─────────────────────────────────┐│
│ │ React Frontend ││
│ │ (Static Files Served) ││
│ └─────────────────────────────────┘│
│ ┌─────────────────────────────────┐│
│ │ API Proxy ││
│ │ (Routes /api/* to backend) ││
│ └─────────────────────────────────┘│
└─────────────────────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ Node.js API Server (Port 8080) │
│ ┌─────────────────────────────────┐│
│ │ Express Backend ││
│ │ (REST API + File Processing) ││
│ └─────────────────────────────────┘│
└─────────────────────────────────────┘
Expected Startup Sequence
-
API Container Builds/Starts
- Installs dependencies
- Builds React client
- Copies client files to shared volume
- Starts Express server on port 8080
- Reports healthy status
-
Nginx Container Starts
- Waits for API container health check
- Finds client files in shared volume
- Starts nginx on port 8081
- Serves React app and proxies API calls
Debugging Information
When containers start, you should see logs like:
etsy-finance-tracker-1 | 📂 Current directory contents:
etsy-finance-tracker-1 | total 123
etsy-finance-tracker-1 | drwxr-xr-x 8 root root 256 Jan 2 12:34 client
etsy-finance-tracker-1 |
etsy-finance-tracker-1 | 📋 Creating shared directory...
etsy-finance-tracker-1 | 📥 Copying client files to shared volume...
etsy-finance-tracker-1 | './client/dist/index.html' -> '/shared/index.html'
etsy-finance-tracker-1 | './client/dist/assets' -> '/shared/assets'
Common Issues & Solutions
🚨 Getting 404 Errors
Symptoms: Browser shows 404 or "Starting Up..." page Causes:
- Client files not copied to shared volume
- Nginx started before files were ready
- Volume mounting issues
Solutions:
- Check container logs for file copying messages
- Restart the stack if timing issue
- Try Option 1 (local build) if using Option 2
🚨 Build Failures
Symptoms: Container fails to start during build Causes:
- Insufficient disk space
- Network issues downloading dependencies
- Node.js version compatibility
Solutions:
- Free up disk space (need ~2GB)
- Check internet connection
- Try restarting Docker service
🚨 Port Already in Use
Symptoms: "Port 8081 already in use" error Solutions:
- Change port in docker-compose file:
ports: - "3000:80" # Use port 3000 instead - Stop other services using the port
Data Persistence
The application includes volume mounting for data persistence:
- MongoDB Data:
./data/mongo:/data/db - Uploaded Files:
./data/uploads:/app/uploads - Logs:
./data/logs:/app/logs
Your data will persist between container restarts.
Development vs Production
- Development: Use
docker-compose.yml(includes hot reload) - Production: Use
docker-compose.deploy-local.ymlordocker-compose.deploy.yml
Support
If you encounter issues:
- Check container logs in your interface
- Verify all containers are running
- Test health endpoint: http://localhost:8081/api/health
- Review this guide for common solutions
Container Interface Specific Instructions
Docker Desktop
- Go to "Compose" tab
- Click "Import" button
- Select the appropriate docker-compose file
- Click "Run"
Portainer
- Go to "Stacks"
- Click "Add stack"
- Choose "Upload" method
- Select the docker-compose file
- Click "Deploy the stack"
Other Interfaces
Most container management tools support docker-compose file import. Look for:
- "Import Compose"
- "Deploy Stack"
- "Upload docker-compose"
- "Create from Compose file"
🎉 Once deployed successfully, you'll have a fully functional Etsy Finance Tracker with comprehensive profit analysis capabilities!