forked from hackoregon/elections-2018-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DOCKERFILE.api.development
54 lines (44 loc) · 1.82 KB
/
DOCKERFILE.api.development
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
FROM python:3.6.5-stretch
MAINTAINER Brian H. Grant <[email protected]> & "M. Edward (Ed) Borasky <[email protected]>
ENV PYTHONUNBUFFERED 1
# add required Debian packages
# https://docs.djangoproject.com/en/2.0/ref/contrib/gis/install/geolibs/
RUN apt-get update && apt-get install -qqy --no-install-recommends \
binutils \
gdal-bin \
libproj-dev \
postgresql-client-9.6 \
&& apt-get clean
#install unzip
RUN apt-get -yqq install curl unzip
RUN apt-get -yqq install xvfb tinywm
# create and populate /code
RUN mkdir /code
WORKDIR /code
COPY /requirements/* /code/
RUN pip install -r development.txt
RUN pip install -r geodjango.txt
RUN python
COPY . /code/
#Install Chrome Web Driver
RUN CHROMEDRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE` && \
mkdir -p /opt/chromedriver-$CHROMEDRIVER_VERSION && \
curl -sS -o /tmp/chromedriver_linux64.zip http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip && \
unzip -qq /tmp/chromedriver_linux64.zip -d /opt/chromedriver-$CHROMEDRIVER_VERSION && \
rm /tmp/chromedriver_linux64.zip && \
chmod +x /opt/chromedriver-$CHROMEDRIVER_VERSION/chromedriver && \
ln -fs /opt/chromedriver-$CHROMEDRIVER_VERSION/chromedriver /usr/local/bin/chromedriver
# Install Google Chrome
RUN curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list && \
apt-get -yqq update && \
apt-get -yqq install google-chrome-stable && \
rm -rf /var/lib/apt/lists/*
#Default configuration
ENV DISPLAY :20.0
ENV SCREEN_GEOMETRY "1440x900x24"
ENV CHROMEDRIVER_PORT 4444
ENV CHROMEDRIVER_WHITELISTED_IPS "127.0.0.1"
ENV CHROMEDRIVER_URL_BASE ''
ENV CHROMEDRIVER_EXTRA_ARGS ''
EXPOSE 4444