- 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
Container Management Interface Deployment Guide
This guide shows how to deploy the Etsy Finance Tracker using container management interfaces like Portainer, Docker Desktop, or similar tools.
🚀 Quick Deployment Steps
Method 1: Stack Deployment (Recommended)
-
Copy the Repository URL:
https://github.com/dlawler489/etsy-finance-tracker -
In your container interface:
🚀 Quick Deployment Steps
Option 1: Simple Deployment (Recommended for First-Time Users)
Use File: docker-compose.simple.yml
This version includes enhanced error handling and automatic client building.
Steps:
- Import the
docker-compose.simple.ymlfile in your container interface - Set Stack Name:
etsy-finance-tracker-simple - Deploy and wait for build completion (~3-5 minutes)
- Access: http://localhost:8081
Option 2: Enhanced Local Build
Use File: docker-compose.deploy-local.yml
This version includes detailed debugging and enhanced logging.
Steps:
- Import the
docker-compose.deploy-local.ymlfile - Set Stack Name:
etsy-finance-tracker-local - Deploy and monitor logs for debugging info
- Access: http://localhost:8081
Option 3: Pre-built Images
Use File: docker-compose.deploy.yml
Uses pre-built images from GitHub Container Registry (may require authentication).
📋 Detailed Instructions by Platform
Using Container Management Interface
-
Import Compose File:
- Docker Desktop: Compose tab → Import → Select file
- Portainer: Stacks → Add stack → Upload file
- Other tools: Look for "Import Compose" or "Deploy Stack"
-
Configure Stack:
- Image:
ghcr.io/dlawler489/etsy-finance-tracker:main - Name:
etsy-finance-tracker - Ports: Internal port 8080 (don't expose externally)
- Environment:
NODE_ENV=productionPORT=8080
- Volumes:
etsy_data:/app/dataetsy_uploads:/app/uploadsclient_dist:/usr/share/nginx/html
- Networks: Create/join
etsy-network - Restart Policy: Unless stopped
Container 2: Nginx Web Server
- Image:
nginx:alpine - Name:
etsy-nginx - Ports:
3000:80(expose port 3000) - Volumes:
- Mount nginx config (see below)
client_dist:/usr/share/nginx/html:ro
- Networks: Join
etsy-network - Depends on:
etsy-finance-tracker - Restart Policy: Unless stopped
📁 Required Files
docker-compose.deploy.yml
version: '3.8'
services:
nginx:
image: nginx:alpine
container_name: etsy-nginx
ports:
- "3000:80"
volumes:
- ./nginx.deploy.conf:/etc/nginx/nginx.conf:ro
- client_dist:/usr/share/nginx/html:ro
depends_on:
- etsy-tracker
restart: unless-stopped
etsy-tracker:
image: ghcr.io/dlawler489/etsy-finance-tracker:main
container_name: etsy-finance-tracker
expose:
- "8080"
environment:
- NODE_ENV=production
- PORT=8080
volumes:
- etsy_data:/app/data
- etsy_uploads:/app/uploads
- client_dist:/usr/share/nginx/html
restart: unless-stopped
command: >
sh -c "
cp -r /app/client/dist/* /usr/share/nginx/html/ 2>/dev/null || true;
exec node server/dist/index.js
"
volumes:
etsy_uploads:
client_dist:
etsy_data:
networks:
etsy-network:
driver: bridge
🔧 Configuration Options
Port Mapping
- External Port: 3000 (change if needed)
- Internal Ports:
- Nginx: 80
- API Server: 8080 (internal only)
Storage Volumes
etsy_data: Your business data (CSV, PDF, Excel files)etsy_uploads: File uploads and temporary filesclient_dist: React app static files (shared between containers)
Environment Variables
NODE_ENV: Set toproductionPORT: API server port (default: 8080)CLIENT_URL: Set tohttp://nginxfor container communication
🌐 Access Your Application
After deployment:
- Web Interface:
http://your-server-ip:3000 - Health Check:
http://your-server-ip:3000/health
🔄 Updates and Management
Update to Latest Version
-
In your container interface:
- Go to Images or Registry
- Pull latest:
ghcr.io/dlawler489/etsy-finance-tracker:main - Recreate the
etsy-trackercontainer with new image
-
Or via Stack Update:
- Edit stack and click "Update"
- Images will automatically update
View Logs
- Container logs available in your interface
- Look for both
etsy-nginxandetsy-finance-trackercontainers
Data Backup
- Your business data is in the
etsy_datavolume - Back up this volume regularly through your interface
🛠 Troubleshooting
Common Issues
-
"unauthorized" Error When Pulling Image
Error: Head "https://ghcr.io/v2/.../manifests/main": unauthorizedSolutions:
- Option 1: Use
docker-compose.deploy-local.ymlinstead (builds locally) - Option 2: Wait for GitHub Actions build to complete
- Option 3: Check that GitHub Container Registry is public
- Option 1: Use
-
Port 3000 Already in Use
- Change external port mapping:
3001:80instead of3000:80
- Change external port mapping:
-
Containers Not Communicating
- Ensure both containers are on same network (
etsy-network) - Check container names match the nginx upstream config
- Ensure both containers are on same network (
-
Static Files Not Loading
- Verify
client_distvolume is shared between containers - Check nginx container logs for file access issues
- Verify
-
API Calls Failing
- Verify
etsy-finance-trackercontainer is running - Check health endpoint:
/health - Review API container logs
- Verify
Health Checks
Both containers include health checks:
- API:
curl http://localhost:8080/health - Nginx:
wget http://localhost/
📊 Monitoring
Your container interface should show:
- Container Status: Both containers running
- Resource Usage: CPU, memory consumption
- Health Status: Green/healthy status
- Port Mappings: Port 3000 accessible externally
🔒 Security Notes
- Internal Communication: API server not exposed externally
- Reverse Proxy: Nginx handles all external requests
- Data Volumes: Business data persists between updates
- Health Monitoring: Built-in container health checks
🎯 Best Practices
- Use Named Volumes: Easier to manage and backup
- Set Restart Policies: Containers restart automatically
- Monitor Resources: Set memory/CPU limits if needed
- Regular Updates: Pull latest images periodically
- Backup Data: Regular backups of
etsy_datavolume