A tool for parsing traffic on the jetstream and applying a moderation workstream based on regexp based rules
1# This file is for setting up the Skywatch Automod service using Docker Compose.
2#
3# Before running `docker compose up`, you need to:
4# 1. Create a `.env` file with your configuration. See the README.md for details.
5# 2. (Optional but recommended) Create an empty `cursor.txt` file in this directory
6# to ensure Docker mounts a file, not a directory.
7# On Linux/macOS: touch cursor.txt
8#
9version: "3.8"
10
11services:
12 redis:
13 image: redis:7-alpine
14 container_name: skywatch-automod-redis
15 restart: unless-stopped
16 command: redis-server --appendonly yes --appendfsync everysec
17 volumes:
18 - redis-data:/data
19 networks:
20 - skywatch-network
21 healthcheck:
22 test: ["CMD", "redis-cli", "ping"]
23 interval: 10s
24 timeout: 3s
25 retries: 3
26
27 automod:
28 # Build the Docker image from the Dockerfile in the current directory.
29 build: .
30 container_name: skywatch-automod
31
32 # Restart the container automatically if it stops unexpectedly.
33 restart: unless-stopped
34
35 # Expose the metrics server port to the host machine.
36 ports:
37 - "4101:4101"
38
39 # Load environment variables from a .env file in the same directory.
40 # This is where you should put your BSKY_HANDLE, BSKY_PASSWORD, etc.
41 env_file:
42 - .env
43
44 # Wait for Redis to be healthy before starting
45 depends_on:
46 redis:
47 condition: service_healthy
48
49 networks:
50 - skywatch-network
51
52 # Mount a volume to persist the firehose cursor.
53 # This links the `cursor.txt` file from your host into the container at `/app/cursor.txt`.
54 # Persisting this file allows the automod to resume from where it left off
55 # after a restart, preventing it from reprocessing old events or skipping new ones.
56 volumes:
57 - ./cursor.txt:/app/cursor.txt
58 - ./.session:/app/.session
59 - ./rules:/app/rules
60
61 environment:
62 - NODE_ENV=production
63 - REDIS_URL=redis://redis:6379
64
65 prometheus:
66 image: prom/prometheus:latest
67 container_name: skywatch-prometheus
68 restart: unless-stopped
69 ports:
70 - "9090:9090"
71 volumes:
72 - ./prometheus.yml:/etc/prometheus/prometheus.yml
73 - prometheus-data:/prometheus
74 command:
75 - "--config.file=/etc/prometheus/prometheus.yml"
76 - "--storage.tsdb.path=/prometheus"
77 networks:
78 - skywatch-network
79 depends_on:
80 - automod
81
82volumes:
83 redis-data:
84 prometheus-data:
85
86networks:
87 skywatch-network:
88 driver: bridge
89 name: skywatch-network