Improve passing env variables
This commit is contained in:
3
.env.example
Normal file
3
.env.example
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
SCRAPER_SMTP_USER=your_mail@example.com
|
||||||
|
SCRAPER_SMTP_PASSWORD=your-secret-password
|
||||||
|
SCRAPER_TO_MAIL=recipient-email@example.com
|
||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
.env
|
||||||
|
|
||||||
# Created by https://www.toptal.com/developers/gitignore/api/python,intellij+all
|
# Created by https://www.toptal.com/developers/gitignore/api/python,intellij+all
|
||||||
# Edit at https://www.toptal.com/developers/gitignore?templates=python,intellij+all
|
# Edit at https://www.toptal.com/developers/gitignore?templates=python,intellij+all
|
||||||
|
|
||||||
|
|||||||
10
README.md
10
README.md
@@ -10,11 +10,19 @@ SCRAPER_SMTP_PASSWORD
|
|||||||
SCRAPER_TO_MAIL
|
SCRAPER_TO_MAIL
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can define them in shell or make use of .env.example file and copy it to `.env` (the docker example uses that approach)
|
||||||
|
|
||||||
It uses Google SMTP server (you have to provide google app credentials).
|
It uses Google SMTP server (you have to provide google app credentials).
|
||||||
|
|
||||||
|
|
||||||
Run with:
|
Run with:
|
||||||
|
|
||||||
```
|
```
|
||||||
python main.py
|
python main.py
|
||||||
|
```
|
||||||
|
|
||||||
|
or build docker image and run it using the docker:
|
||||||
|
|
||||||
|
```
|
||||||
|
docker build -t lidl-price-scraper .
|
||||||
|
docker run -it --rm --env-file ./.env lidl-price-scraper
|
||||||
```
|
```
|
||||||
Reference in New Issue
Block a user