Add dockerfile and fix readme

This commit is contained in:
2024-02-01 11:02:58 +01:00
parent e8a4b83843
commit 8810851284
3 changed files with 13 additions and 3 deletions

10
Dockerfile Normal file
View File

@@ -0,0 +1,10 @@
FROM python:3.9-slim
WORKDIR /app
COPY . /app
RUN pip install --no-cache-dir -r /app/requirements.txt
# Run app.py when the container launches
CMD ["python", "/app/main.py"]

View File

@@ -7,7 +7,7 @@ It also sends a notification of items via email any items is on sale and followi
```
SCRAPER_SMTP_USER
SCRAPER_SMTP_PASSWORD
SCRAPER_SMTP_USER
SCRAPER_TO_MAIL
```
It uses Google SMTP server (you have to provide google app credentials).
@@ -16,5 +16,5 @@ It uses Google SMTP server (you have to provide google app credentials).
Run with:
```
python scrape.py
python main.py
```

View File

@@ -52,4 +52,4 @@ if __name__ == "__main__":
if len(products_on_sale) > 0:
sender = EmailSender(os.environ["SCRAPER_SMTP_USER"], os.environ["SCRAPER_SMTP_PASSWORD"])
sender.send_email(os.environ["SCRAPER_SMTP_USER"], products_on_sale)
sender.send_email(os.environ["SCRAPER_TO_MAIL"], products_on_sale)