Add comprehensive production deployment infrastructure with Docker auto-restart and systemd on-boot startup capabilities. Changes: - Add deploy-production-docker.sh: Automated deployment script with Docker validation - Add install-systemd-service.sh: Systemd service installer for auto-start on boot - Add scripts/mev-bot.service: Systemd service definition for MEV bot - Update docker-compose.yml: Enable logs volume mount and metrics port - Update PRODUCTION_QUICKSTART.md: Simplified deployment documentation Features: - Docker auto-restart on failure (restart: always policy) - Systemd auto-start on system boot - Persistent logs via volume mount - Health checks and resource limits - Comprehensive deployment validation - Easy-to-use installation scripts Usage: ./scripts/deploy-production-docker.sh # Deploy with Docker sudo ./scripts/install-systemd-service.sh # Enable auto-start on boot 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
mev-bot:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
image: mev-bot:latest
|
|
container_name: mev-bot-production
|
|
restart: always
|
|
volumes:
|
|
# Mount only the config file for production
|
|
- ./config/config.production.yaml:/app/config/config.yaml:ro
|
|
# Mount logs directory for persistent logs
|
|
- ./logs:/app/logs
|
|
environment:
|
|
- LOG_LEVEL=${LOG_LEVEL:-info}
|
|
- ARBITRUM_RPC_ENDPOINT=${ARBITRUM_RPC_ENDPOINT:-https://arbitrum-rpc.publicnode.com}
|
|
# Add any other environment variables from .env file
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "${PORT:-8080}:8080"
|
|
- "${METRICS_PORT:-9090}:9090"
|
|
command: ["start"]
|
|
# Health check to ensure the bot is running properly
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pgrep -f mev-bot || exit 1"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
# Security options
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
# Resource limits (adjust as needed)
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: '2'
|
|
memory: 2G
|
|
reservations:
|
|
cpus: '0.5'
|
|
memory: 512M |