# This file is for setting up the Skywatch Automod service using Docker Compose. # # Before running `docker compose up`, you need to: # 1. Create a `.env` file with your configuration. See the README.md for details. # 2. (Optional but recommended) Create an empty `cursor.txt` file in this directory # to ensure Docker mounts a file, not a directory. # On Linux/macOS: touch cursor.txt # version: "3.8" services: redis: image: redis:7-alpine container_name: skywatch-automod-redis restart: unless-stopped command: redis-server --appendonly yes --appendfsync everysec volumes: - redis-data:/data networks: - skywatch-network healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 3s retries: 3 automod: # Build the Docker image from the Dockerfile in the current directory. build: . container_name: skywatch-automod # Restart the container automatically if it stops unexpectedly. restart: unless-stopped # Expose the metrics server port to the host machine. ports: - "4101:4101" # Load environment variables from a .env file in the same directory. # This is where you should put your BSKY_HANDLE, BSKY_PASSWORD, etc. env_file: - .env # Wait for Redis to be healthy before starting depends_on: redis: condition: service_healthy networks: - skywatch-network # Mount a volume to persist the firehose cursor. # This links the `cursor.txt` file from your host into the container at `/app/cursor.txt`. # Persisting this file allows the automod to resume from where it left off # after a restart, preventing it from reprocessing old events or skipping new ones. volumes: - ./cursor.txt:/app/cursor.txt - ./.session:/app/.session - ./rules:/app/rules environment: - NODE_ENV=production - REDIS_URL=redis://redis:6379 prometheus: image: prom/prometheus:latest container_name: skywatch-prometheus restart: unless-stopped ports: - "9090:9090" volumes: - ./prometheus.yml:/etc/prometheus/prometheus.yml - prometheus-data:/prometheus command: - "--config.file=/etc/prometheus/prometheus.yml" - "--storage.tsdb.path=/prometheus" networks: - skywatch-network depends_on: - automod volumes: redis-data: prometheus-data: networks: skywatch-network: driver: bridge name: skywatch-network