- Fix TypeScript errors in enhanced-screenshot.ts and tradingview-automation.ts - Add proper type assertions for page.screenshot() path parameter - Ensure compatibility with strict TypeScript compilation - Verify Docker Compose V2 deployment working on port 9000 - Application successfully containerized and production-ready - All build processes pass without TypeScript errors Ready for easy deployment on any machine with Docker & Docker Compose V2
58 lines
1.3 KiB
YAML
58 lines
1.3 KiB
YAML
# Docker Compose for production
|
|
# Use: docker compose -f docker-compose.yml -f docker-compose.prod.yml up
|
|
|
|
services:
|
|
app:
|
|
# Production-specific settings
|
|
environment:
|
|
- NODE_ENV=production
|
|
- DOCKER_ENV=true
|
|
|
|
# Load production environment variables
|
|
env_file:
|
|
- .env.production
|
|
|
|
# Production command
|
|
command: ["npm", "start"]
|
|
|
|
# Only expose necessary port
|
|
ports:
|
|
- "9000:3000"
|
|
|
|
# Remove network_mode: host to avoid port conflicts
|
|
# Use bridge network instead
|
|
networks:
|
|
- default
|
|
|
|
# Production volumes (no source code mounting)
|
|
volumes:
|
|
- ./screenshots:/app/screenshots
|
|
- ./videos:/app/videos
|
|
- ./.tradingview-session:/app/.tradingview-session
|
|
- ./prisma:/app/prisma
|
|
- /tmp/.X11-unix:/tmp/.X11-unix:rw
|
|
|
|
# Production labels
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.routers.trading-bot.rule=Host(`trading-bot.local`)"
|
|
|
|
# Resource limits for production
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 2G
|
|
reservations:
|
|
memory: 1G
|
|
|
|
# Restart policy
|
|
restart: unless-stopped
|
|
|
|
# Health check
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|