- 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.
77 lines
No EOL
2.2 KiB
YAML
77 lines
No EOL
2.2 KiB
YAML
services:
|
|
# Nginx reverse proxy and static file server
|
|
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:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
networks:
|
|
- etsy-network
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 20s
|
|
|
|
# Etsy Finance Tracker API Server (built locally)
|
|
etsy-tracker:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: etsy-finance-tracker
|
|
expose:
|
|
- "8080"
|
|
environment:
|
|
- NODE_ENV=production
|
|
- PORT=8080
|
|
- CLIENT_URL=http://nginx
|
|
volumes:
|
|
# Persistent data storage
|
|
- etsy_data:/app/data
|
|
# Optional: Mount uploads directory
|
|
- etsy_uploads:/app/uploads
|
|
# Share client build with nginx
|
|
- client_dist:/usr/share/nginx/html
|
|
restart: unless-stopped
|
|
networks:
|
|
- etsy-network
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
# Copy client files to shared volume and start server
|
|
command: >
|
|
sh -c "
|
|
echo '🚀 Starting Etsy Finance Tracker API Server...';
|
|
echo '📁 Checking for client files...';
|
|
ls -la /app/client/dist/ || echo 'No client dist directory found';
|
|
echo '📋 Copying client files to shared volume...';
|
|
mkdir -p /usr/share/nginx/html;
|
|
cp -rv /app/client/dist/* /usr/share/nginx/html/ 2>/dev/null || echo 'Copy failed or no files to copy';
|
|
echo '✅ Client files in shared volume:';
|
|
ls -la /usr/share/nginx/html/ || echo 'No files in shared volume';
|
|
echo '🔍 Starting Node.js server on port 8080...';
|
|
exec node server/dist/index.js
|
|
"
|
|
|
|
volumes:
|
|
etsy_uploads:
|
|
driver: local
|
|
client_dist:
|
|
driver: local
|
|
etsy_data:
|
|
driver: local
|
|
|
|
networks:
|
|
etsy-network:
|
|
driver: bridge |