- 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.
79 lines
No EOL
2.4 KiB
YAML
79 lines
No EOL
2.4 KiB
YAML
services:
|
|
etsy-finance-tracker:
|
|
build: .
|
|
container_name: etsy-finance-tracker
|
|
environment:
|
|
- NODE_ENV=production
|
|
- PORT=8080
|
|
ports:
|
|
- "8080:8080"
|
|
volumes:
|
|
- ./data:/app/data
|
|
- shared-volume:/shared
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8080/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
command: >
|
|
sh -c "
|
|
echo '🚀 Starting Etsy Finance Tracker API Server...' &&
|
|
echo '📂 Current directory contents:' &&
|
|
ls -la &&
|
|
echo '📂 Client directory contents:' &&
|
|
ls -la client/ || echo 'No client directory found' &&
|
|
echo '📂 Client dist contents:' &&
|
|
ls -la client/dist/ || echo 'No client/dist directory found' &&
|
|
echo '📋 Creating shared directory...' &&
|
|
mkdir -p /shared &&
|
|
echo '📥 Attempting to copy client files...' &&
|
|
if [ -d 'client/dist' ]; then
|
|
echo '✅ Found client/dist directory, copying...' &&
|
|
cp -rv client/dist/* /shared/ &&
|
|
echo '🎉 Client files copied successfully!' &&
|
|
ls -la /shared/
|
|
else
|
|
echo '❌ No client/dist directory found. Building client...' &&
|
|
cd client &&
|
|
npm install &&
|
|
npm run build &&
|
|
cd .. &&
|
|
echo '📥 Copying newly built client files...' &&
|
|
cp -rv client/dist/* /shared/ &&
|
|
echo '🎉 Client files built and copied!'
|
|
fi &&
|
|
echo '🚀 Starting Node.js server...' &&
|
|
node dist/index.js
|
|
"
|
|
restart: unless-stopped
|
|
|
|
nginx:
|
|
image: nginx:alpine
|
|
container_name: etsy-nginx
|
|
ports:
|
|
- "8081:80"
|
|
volumes:
|
|
- ./nginx.deploy.conf:/etc/nginx/conf.d/default.conf
|
|
- shared-volume:/usr/share/nginx/html
|
|
depends_on:
|
|
etsy-finance-tracker:
|
|
condition: service_healthy
|
|
command: >
|
|
sh -c "
|
|
echo '🌐 Starting nginx server...' &&
|
|
echo '📂 Checking shared volume contents:' &&
|
|
ls -la /usr/share/nginx/html/ &&
|
|
if [ ! -f '/usr/share/nginx/html/index.html' ]; then
|
|
echo '⏳ Waiting for client files to be available...' &&
|
|
sleep 10 &&
|
|
ls -la /usr/share/nginx/html/
|
|
fi &&
|
|
echo '🚀 Starting nginx...' &&
|
|
nginx -g 'daemon off;'
|
|
"
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
shared-volume:
|
|
driver: local |