-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.production
33 lines (24 loc) · 1.37 KB
/
Dockerfile.production
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
FROM geographica/gdal2:2.4.0
RUN apt-get clean && apt-get update && \
apt-get -y -qq install unzip curl python3-pip chromium-browser python3-lxml && \
pip3 install pipenv==2018.11.26
RUN export MAIN_CHROME_VERSION=$(apt-cache policy chromium-browser | grep -oP "Installed: \K\w+") && \
echo "Installed chromium-browser ${MAIN_CHROME_VERSION}" && \
export CHROMEDRIVER_VERSION=$(curl https://chromedriver.storage.googleapis.com/ | grep -oP "(?<=<Key>)${MAIN_CHROME_VERSION}\.[0-9.]+(?=/chromedriver_linux64.zip</Key>)" | tail -1) && \
echo "Installing chromedriver version ${CHROMEDRIVER_VERSION}" && \
(cd /tmp && curl -O "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip" && unzip chromedriver_linux64.zip -d /usr/bin && rm chromedriver_linux64.zip)
RUN mkdir /code
WORKDIR /code
# http://click.pocoo.org/python3/
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
COPY docker/Pipfile* /code/
COPY docker/requirements.production.txt /code/
RUN pipenv install --system
RUN pip3 install -r requirements.production.txt
COPY src /code/src
# because docker-compose passes empty string if environment variable is not defined at host, the following default value is not used
# https://github.com/docker/compose/issues/3608
ARG UID_GID=0:0
# therefore we need to use it in this way anywhere below: ${UID_GID:-"0:0"}
RUN chown -R ${UID_GID:-"0:0"} src