Docker file change from Debian stretch to Alpine

This commit is contained in:
Marian Steinbach 2018-09-12 00:42:40 +02:00
parent eb9a29ac1c
commit 8580747e2a
2 changed files with 11 additions and 14 deletions

View File

@ -1,16 +1,13 @@
FROM debian:stretch-slim
FROM python:3.6-alpine3.7
RUN apt-get update \
&& apt-get install -y git wget gnupg fonts-liberation libappindicator3-1 \
libasound2 libatk-bridge2.0-0 libatk1.0-0 libcairo2 libcups2 libdbus-1-3 \
libexpat1 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 \
libpango-1.0-0 libpangocairo-1.0-0 libx11-6 libx11-xcb1 libxcb1 \
libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 \
libxrandr2 libxrender1 libxss1 libxtst6 lsb-release xdg-utils \
python3 python3-pip unzip chromium-driver \
&& apt-get clean \
&& pip3 install GitPython idna PyYAML beautifulsoup4==4.6.0 requests==2.18.4 responses==0.9.0 selenium==3.14.0 smmap2==2.0.3 urllib3==1.22 google-cloud-datastore==1.7.0 tenacity==5.0.2 \
&& apt-get clean
# Note: we pin selenium to 3.8.0 because of https://github.com/SeleniumHQ/selenium/issues/5296
RUN echo "http://dl-4.alpinelinux.org/alpine/v3.7/main" >> /etc/apk/repositories && \
echo "http://dl-4.alpinelinux.org/alpine/v3.7/community" >> /etc/apk/repositories && \
apk update && \
apk --no-cache add chromium chromium-chromedriver python3-dev build-base git && \
pip3 install --upgrade pip && \
pip3 install selenium==3.8.0 GitPython PyYAML beautifulsoup4==4.6.0 requests==2.18.4 responses==0.9.0 smmap2==2.0.3 urllib3==1.22 google-cloud-datastore==1.7.0 tenacity==5.0.2 && \
apk del python3-dev build-base
ADD spider.py /
ADD spider_test.py /

View File

@ -4,7 +4,6 @@
# Build docker image
dockerimage:
docker pull debian:stretch-slim
docker build -t spider .
# Create spider job queue
@ -19,11 +18,12 @@ spiderjobs: dockerimage
# Run spider in docker image
spider: dockerimage
docker run --rm -ti \
-v $(PWD)/dev-shm:/dev/shm \
-v $(PWD)/webapp/dist/data:/out \
-v $(PWD)/secrets:/secrets \
spider spider.py \
--credentials-path /secrets/datastore-writer.json \
--loglevel debug \
--loglevel info \
spider
# run spider tests