-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.production
58 lines (45 loc) · 2.27 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
FROM osgeo/gdal:ubuntu-small-3.3.0
# Configure apt for installing chromium and chromedriver from debian repos - START
# https://askubuntu.com/a/1206502
RUN apt-get clean && apt-get update && \
apt-get -y -qq install debian-archive-keyring
RUN echo 'deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://security.debian.org/debian-security stable-security main\n\
deb-src [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://security.debian.org/debian-security stable-security main\n\
\n\
deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://security.debian.org/debian-security stable-security/updates main\n\
deb-src [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://security.debian.org/debian-security stable-security/updates main\n\
\n\
deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian stable main\n\
deb-src [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian stable main\n'\
>> /etc/apt/sources.list.d/debian-stable.list
RUN echo 'Explanation: Allow installing chromium from the debian repo.\n\
Package: chromium*\n\
Pin: origin "*.debian.org"\n\
Pin-Priority: 100\n\
\n\
Explanation: Avoid other packages from the debian repo.\n\
Package: *\n\
Pin: origin "*.debian.org"\n\
Pin-Priority: 1\n'\
>> /etc/apt/preferences.d/debian-chromium
# Configure apt for installing chromium and chromedriver from debian repos - END
RUN apt-get clean && apt-get update && apt-get upgrade -y && \
apt-get -y -qq install nano python3-pip python3-lxml && \
apt-get -y -qq install libwebpmux3=0.6.1-2.1 && \
apt-get -y -qq install chromium chromium-driver && \
pip install pipenv==2020.11.15
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 pip 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