Add dockerfile and fix readme
This commit is contained in:
10
Dockerfile
Normal file
10
Dockerfile
Normal 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"]
|
||||||
@@ -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_USER
|
||||||
SCRAPER_SMTP_PASSWORD
|
SCRAPER_SMTP_PASSWORD
|
||||||
SCRAPER_SMTP_USER
|
SCRAPER_TO_MAIL
|
||||||
```
|
```
|
||||||
|
|
||||||
It uses Google SMTP server (you have to provide google app credentials).
|
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:
|
Run with:
|
||||||
|
|
||||||
```
|
```
|
||||||
python scrape.py
|
python main.py
|
||||||
```
|
```
|
||||||
@@ -52,4 +52,4 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
if len(products_on_sale) > 0:
|
if len(products_on_sale) > 0:
|
||||||
sender = EmailSender(os.environ["SCRAPER_SMTP_USER"], os.environ["SCRAPER_SMTP_PASSWORD"])
|
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)
|
||||||
Reference in New Issue
Block a user