47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
services:
|
|
flat-scraper:
|
|
build: .
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ./data:/app/data
|
|
- ./src/config:/app/src/config
|
|
- ./.env:/app/.env:ro
|
|
environment:
|
|
- TZ=Europe/Vienna
|
|
# For ARM64 (Raspberry Pi) - uncomment if needed
|
|
# platform: linux/arm64
|
|
|
|
# Optional: Add a scheduler service for automated runs
|
|
scheduler:
|
|
build: .
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ./data:/app/data
|
|
- ./src/config:/app/src/config
|
|
- ./.env:/app/.env:ro
|
|
environment:
|
|
- TZ=Europe/Vienna
|
|
command: >
|
|
python -c "
|
|
import schedule
|
|
import time
|
|
from src.main import FlatScraper
|
|
|
|
def run_scraper():
|
|
scraper = FlatScraper()
|
|
scraper.run_once()
|
|
|
|
# Schedule every 6 hours
|
|
schedule.every(6).hours.do(run_scraper)
|
|
|
|
print('Scheduler started. Running every 6 hours.')
|
|
run_scraper() # Run immediately
|
|
|
|
while True:
|
|
schedule.run_pending()
|
|
time.sleep(60)
|
|
"
|
|
# platform: linux/arm64
|
|
depends_on:
|
|
- flat-scraper
|