mirror of
https://github.com/DiegoCaraballo/Email-extractor.git
synced 2024-09-20 06:46:01 +08:00
Added docker support
This commit is contained in:
parent
aee7adceae
commit
1cedbc2549
6
.env.example
Normal file
6
.env.example
Normal file
|
@ -0,0 +1,6 @@
|
|||
NETWORK_EMAIL_EXTRACTOR=network-email-extractor
|
||||
|
||||
APP_NAME=email-extractor
|
||||
APP_IMAGE=python
|
||||
APP_IMAGE_LOCAL=localhost
|
||||
APP_VERSION=3.7.4-buster
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
Emails.db
|
||||
.google-cookie
|
||||
/venv
|
||||
*env
|
||||
|
|
15
Dockerfile
Normal file
15
Dockerfile
Normal file
|
@ -0,0 +1,15 @@
|
|||
ARG IMAGE
|
||||
|
||||
ARG VERSION
|
||||
|
||||
FROM $IMAGE:$VERSION
|
||||
|
||||
# IMPORTANT: remeber to declare ARG values AFTER FROM sentence....
|
||||
|
||||
MAINTAINER info@kedu.coop
|
||||
|
||||
ADD requirements.txt .
|
||||
|
||||
ADD EmailExtractor.py .
|
||||
|
||||
RUN pip install -r requirements.txt
|
41
README.md
41
README.md
|
@ -38,3 +38,44 @@ pip install -r requirements.txt
|
|||
|
||||
|
||||
[Extraer correos de paginas web con Python](http://www.pythondiario.com/2018/04/extraer-correos-electronicos-de-paginas.html)
|
||||
|
||||
## Docker
|
||||
|
||||
Docker and docker-compose are required.
|
||||
|
||||
In order to use docker follow below instructions:
|
||||
|
||||
### Installation
|
||||
|
||||
1. Get an .env file
|
||||
|
||||
```
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
2. Start docker container
|
||||
|
||||
```
|
||||
docker-compose up -d --build
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
To execute the script and get the options menu:
|
||||
|
||||
```
|
||||
docker exec -ti email-extractor python EmailExtractor.py
|
||||
```
|
||||
|
||||
To get the sqlite db with al e-mails:
|
||||
|
||||
```
|
||||
docker cp email-extractor:Emails.db .
|
||||
```
|
||||
|
||||
To get the file saved, for instance, as "out":
|
||||
|
||||
```
|
||||
ocker cp email-extractor:out.txt .
|
||||
```
|
||||
|
||||
|
|
20
docker-compose.yaml
Normal file
20
docker-compose.yaml
Normal file
|
@ -0,0 +1,20 @@
|
|||
version: '3.7'
|
||||
|
||||
services:
|
||||
|
||||
email-extractor:
|
||||
container_name: ${APP_NAME}
|
||||
image: ${APP_IMAGE_LOCAL}/${APP_NAME}:${APP_VERSION}
|
||||
networks:
|
||||
- ${NETWORK_EMAIL_EXTRACTOR}
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
- IMAGE=${APP_IMAGE}
|
||||
- VERSION=${APP_VERSION}
|
||||
stdin_open: true
|
||||
tty: true
|
||||
|
||||
networks:
|
||||
network-email-extractor:
|
||||
name: ${NETWORK_EMAIL_EXTRACTOR}
|
Loading…
Reference in a new issue