This repository was archived by the owner on Sep 11, 2019. It is now read-only.
forked from jroo/hourglass
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDockerfile
More file actions
45 lines (35 loc) · 1.67 KB
/
Dockerfile
File metadata and controls
45 lines (35 loc) · 1.67 KB
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
FROM python:3.6.4
ENV NODE_VERSION=6
RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash -
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
RUN apt-get update && \
apt-get install -y \
nodejs unzip \
# Note that we want postgresql-client so 'manage.py dbshell' works.
postgresql-client \
# This is some kind of dependency for headless chrome; See https://crbug.com/795759.
libgconf-2-4 \
# Install latest chrome stable package and dependencies.
# Note that ideally we'd explicitly specify the version of Chrome to use,
# but there are complications; see https://github.com/18F/calc/issues/1964
# for more details.
google-chrome-stable ttf-freefont \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /src/*.deb
RUN pip install virtualenv
WORKDIR /calc
RUN npm install -g yarn
# Hopefully the latest stable ChromeDriver is compatible with the latest
# stable Chrome. I wish there were more consistently reproducible &
# reliable ways around this, but there don't seem to be; see
# https://github.com/18F/calc/issues/1964 for more details.
RUN wget -N https://chromedriver.storage.googleapis.com/LATEST_RELEASE && \
wget -N https://chromedriver.storage.googleapis.com/`cat LATEST_RELEASE`/chromedriver_linux64.zip \
&& unzip chromedriver_linux64.zip \
&& chmod +x chromedriver \
&& mv chromedriver /usr/local/bin/chromedriver
ENV PATH /calc/node_modules/.bin:$PATH
ENV DDM_IS_RUNNING_IN_DOCKER yup
ENTRYPOINT ["python", "/calc/docker_django_management.py"]