flathunters / flathunter

A bot to help people with their rental real-estate search. 🏠🤖
GNU Affero General Public License v3.0
855 stars 183 forks source link

Running with docker does not work - docker-compose file #351

Open Baumkoenigin opened 1 year ago

Baumkoenigin commented 1 year ago

I have create a docker image of the flathunter files with docker-compose. However, when I try to test it within Docker Desktop it does not send any results to my Telegram. When I run the script locally within visual studio it works fine.

I think this might be related to my docker-compose.yaml file. Here is my file:

version: '3'

services:
  app:
    build: .
    platform: linux/amd64 # For M1 to install google-chrome-stable; However still crashes on M1 when launching chrome (selenium.common.exceptions.WebDriverException: Message: unknown error: unable to discover open window in chrome (Session info: headless chrome=109.0.5414.119))
    command: python flathunt.py
    restart: always
    environment:
      - FLATHUNTER_TARGET_URLS=
        https://www.ebay-kleinanzeigen.de/s-wohnung-mieten/wismar/preis::1000/c203l137;
        https://www.ebay-kleinanzeigen.de/s-wohnung-mieten/rostock/preis::1000/c203l137

      # - FLATHUNTER_DATABASE_LOCATION=
      # - FLATHUNTER_GOOGLE_CLOUD_PROJECT_ID=
      # - FLATHUNTER_VERBOSE_LOG=
      - FLATHUNTER_LOOP_PERIOD_SECONDS=600
      - FLATHUNTER_MESSAGE_FORMAT= {title} {rooms} {size} {price} {address} {url}
      - FLATHUNTER_NOTIFIERS=telegram
      - FLATHUNTER_TELEGRAM_BOT_TOKEN=5831...:XXX
      - FLATHUNTER_TELEGRAM_RECEIVER_IDS=444...
      # - FLATHUNTER_MATTERMOST_WEBHOOK_URL=
      # - FLATHUNTER_WEBSITE_SESSION_KEY=
      # - FLATHUNTER_WEBSITE_DOMAIN=
      # - FLATHUNTER_2CAPTCHA_KEY=
      # - FLATHUNTER_IMAGETYPERZ_TOKEN=
      # - FLATHUNTER_HEADLESS_BROWSER=yes
    volumes:
      - ./:/usr/src/app # not ideal, but the only way to incorporate the database (processed_ids.db), which is currently created at runtime

I am grateful for any guidance! - Thanks!

codders commented 1 year ago

Hi @Baumkoenigin ,

Do you get any logging from docker when you run this?