Run python unit tests in docker container

pull/35/head
Marian Steinbach 4 years ago
parent cf656ad2d1
commit 1e4cb2bce8
  1. 4
      Dockerfile
  2. 15
      Makefile

@ -27,5 +27,7 @@ RUN wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x
&& rm -rf phantomjs-2.1.1-linux-x86_64
ADD spider.py /
ADD test.py /
ENTRYPOINT ["python3", "/spider.py"]
ENTRYPOINT ["python3"]
CMD ["/spider.py"]

@ -1,13 +1,19 @@
.PHONY: webapp
.PHONY: webapp dockerimage
# Build docker image and run spider in Docker container
spider:
# Build docker image
dockerimage:
docker pull debian:stretch-slim
docker build -t spider .
# Run spider in docker image
spider: dockerimage
docker run --rm -ti -v $(PWD)/webapp/dist/data:/out spider
test: dockerimage
docker run --rm -ti spider /test.py
screenshots: venv
docker pull netzbegruenung/green-spider-screenshotter:latest
venv/bin/python ./screenshots.py
@ -23,6 +29,3 @@ webapp: webapp/node_modules
serve-webapp:
cd docs && ../venv/bin/python -m http.server
test: venv
venv/bin/python ./test.py

Loading…
Cancel
Save