🧩 Quick Start — Docker Compose¶
This variant runs Engined as a container service ready to work with RabbitMQ.
✅ Requirements¶
- Docker + Docker Compose
- Running RabbitMQ instance
- Existing Docker network
antiginx(defined asexternal)
Create the network (one-time setup) if you don't have it:
1️⃣ Prepare .env File¶
Create a .env file in the project root directory:
ENGINE_PORT=5000
BACK_URL=http://backend:3000/api/results
RABBITMQ_URL=amqp://guest:guest@rabbitmq:5672/
📋 About Environment Variables:
ENGINE_PORTis used bydocker-compose.ymlfor port mapping (${ENGINE_PORT}:5000).BACK_URLandRABBITMQ_URLare passed into the container as environment variables.
2️⃣ Create docker-compose.yml¶
Create or update the docker-compose.yml file in your project root:
version: '3.8'
services:
engine-antiginx:
image: ghcr.io/prawo-i-piesc/engine-antiginx:latest
container_name: engine-antiginx-worker
restart: unless-stopped
ports:
- "${ENGINE_PORT}:5000"
environment:
- RABBITMQ_URL=${RABBITMQ_URL}
- BACK_URL=${BACK_URL}
mem_limit: 1024m
networks:
- antiginx
networks:
antiginx:
external: true
💡 Customization:
- Change
ghcr.io/prawo-i-piesc/engine-antiginx:latestto your own registry if needed. - Adjust
mem_limitbased on your scan complexity and server capacity.
3️⃣ Start Services¶
Start the container in detached mode:
✅ Quick Validation¶
Check status:
View logs:
4️⃣ Stop Services¶
Stop and remove containers:
🔄 How It Works¶
- Container launches the
/engine-antiginx/Enginedbinary. - Worker consumes messages from the
scan_queuequeue. - Each task message (JSON format) triggers a scan via
App(rawjsonmode). - Results and errors are ACK/NACK'd according to retry logic.
📤 Message Format Example¶
When sending a task to RabbitMQ, use this JSON structure:
{
"Target": "https://example.com",
"Parameters": [
{
"Name": "--tests",
"Arguments": ["https", "hsts", "serv-h-a"]
},
{
"Name": "--taskId",
"Arguments": ["task-123"]
}
]
}
🔧 Troubleshooting¶
- Error:
network antiginx declared as external, but could not be found→ Create the network:docker network create antiginx. - Empty/incorrect
RABBITMQ_URL→ Update.envand restart withdocker compose up -d. - No results reaching backend → Verify the
BACK_URLendpoint is reachable from the container network. - Worker keeps crashing → Check logs with
docker compose logs -f engine-antiginxand verify RabbitMQ connectivity.