initial commit
This commit is contained in:
48
docker-compose.yml
Normal file
48
docker-compose.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
version: '3.8'
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user