🔧 Fix Container Deployment Issues: - Add docker-compose.deploy-local.yml for local builds (fallback) - Updated deployment guide with unauthorized error troubleshooting - GitHub Actions workflow improvements for package visibility 📦 Two Deployment Options: 1. docker-compose.deploy.yml - Uses pre-built GHCR image (fast) 2. docker-compose.deploy-local.yml - Builds locally (reliable fallback) 🛠 Troubleshooting Added: - Clear instructions for 'unauthorized' error - Step-by-step fallback to local builds - GitHub Container Registry access solutions ✅ Immediate Solution: Use docker-compose.deploy-local.yml in container interface: - Builds image locally from source - No dependency on GitHub Container Registry - Works immediately while GHCR access is resolved
76 lines
No EOL
1.9 KiB
YAML
76 lines
No EOL
1.9 KiB
YAML
version: '3.8'
|
|
|
|
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
|
|
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: 10s
|
|
|
|
# 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...';
|
|
if [ ! -f /usr/share/nginx/html/index.html ]; then
|
|
echo 'Copying client files to shared volume...';
|
|
cp -r /app/client/dist/* /usr/share/nginx/html/ 2>/dev/null || true;
|
|
echo 'Client files copied successfully';
|
|
fi;
|
|
echo 'Starting Node.js server...';
|
|
exec node server/dist/index.js
|
|
"
|
|
|
|
volumes:
|
|
etsy_uploads:
|
|
driver: local
|
|
client_dist:
|
|
driver: local
|
|
etsy_data:
|
|
driver: local
|
|
|
|
networks:
|
|
etsy-network:
|
|
driver: bridge |