Change to run spider in Docker container

This commit is contained in:
Marian Steinbach 2018-05-03 10:22:10 +02:00
parent 7ce779e52d
commit 4de5890c60
4 changed files with 21 additions and 8 deletions

6
.dockerignore Normal file
View file

@ -0,0 +1,6 @@
.git
webapp
docs
secrets
temp
venv

View file

@ -1 +1,10 @@
FROM python:3.6-alpine3.7 FROM python:3.6-alpine3.7
ADD requirements.txt /
RUN pip install -r requirements.txt
RUN apk add --no-cache git
ADD spider.py /
ENTRYPOINT ["python", "spider.py"]

View file

@ -2,13 +2,11 @@
.PHONY: webapp .PHONY: webapp
# Python venv for running the spider locally # Build docker image and run spider in Docker container
venv: spider:
virtualenv -p python3 venv docker pull python:3.6-alpine3.7
venv/bin/pip3 install -r requirements.txt docker build -t spider .
docker run --rm -ti -v $(PWD):/out spider
spider: venv
venv/bin/python ./spider.py
screenshots: venv screenshots: venv
docker pull netzbegruenung/green-spider-screenshotter:latest docker pull netzbegruenung/green-spider-screenshotter:latest

View file

@ -37,7 +37,7 @@ green_directory_repo = 'https://github.com/netzbegruenung/green-directory.git'
green_direcory_data_path = 'data/countries/de' green_direcory_data_path = 'data/countries/de'
green_directory_local_path = './cache/green-directory' green_directory_local_path = './cache/green-directory'
result_path = './webapp/dist/data' result_path = '/out'
# IP address of the newthinking GCMS server # IP address of the newthinking GCMS server
gcms_ip = "91.102.13.20" gcms_ip = "91.102.13.20"