Browse Source

Change to run spider in Docker container

pull/34/head
Marian Steinbach 4 years ago
parent
commit
4de5890c60
  1. 6
      .dockerignore
  2. 9
      Dockerfile
  3. 12
      Makefile
  4. 2
      spider.py

6
.dockerignore

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

9
Dockerfile

@ -1 +1,10 @@
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"]

12
Makefile

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

2
spider.py

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

Loading…
Cancel
Save