forked from alltheplaces/alltheplaces
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
79 lines (67 loc) · 1.97 KB
/
Dockerfile
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
FROM ubuntu:22.04
# This is from https://hub.docker.com/r/yahwang/ubuntu-pyenv/dockerfile
ARG PYTHON_VERSION=3.11
ARG BUILD_PYTHON_DEPS=" \
make \
build-essential \
libbz2-dev \
libffi-dev \
libgdbm-dev \
liblzma-dev \
libncurses5-dev \
libncursesw5-dev \
libnss3-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
xz-utils \
zlib1g-dev \
"
ARG BUILD_OPT_DEPS=" \
sudo \
locales \
git \
ca-certificates \
curl \
jq \
zip \
"
# basic update & locale setting
RUN apt-get update \
&& apt-get upgrade -yqq \
&& apt-get install -yqq --no-install-recommends \
${BUILD_PYTHON_DEPS} \
${BUILD_OPT_DEPS} \
&& localedef -f UTF-8 -i en_US en_US.UTF-8 \
&& useradd -m -s /bin/bash ubuntu \
&& echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
&& apt-get autoremove -yqq --purge \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
USER ubuntu
WORKDIR /home/ubuntu
ENV LANG=en_US.UTF-8 \
PYENV_ROOT="/home/ubuntu/.pyenv" \
PATH="/home/ubuntu/.pyenv/versions/${PYTHON_VERSION}/bin:/home/ubuntu/.pyenv/bin:/home/ubuntu/.pyenv/shims:$PATH"
# install tippecanoe
ARG TIPPECANOE_VERSION=2.29.0
RUN curl -sL https://github.com/felt/tippecanoe/archive/refs/tags/${TIPPECANOE_VERSION}.tar.gz | tar -xz \
&& cd tippecanoe-${TIPPECANOE_VERSION} \
&& make -j \
&& sudo make install \
&& cd .. \
&& rm -rf tippecanoe-${TIPPECANOE_VERSION}
# install pyenv & python
RUN curl https://pyenv.run | bash \
&& pyenv install ${PYTHON_VERSION} \
&& pyenv global ${PYTHON_VERSION} \
&& pip install --upgrade pip pipenv==2023.12.1
COPY Pipfile Pipfile
COPY Pipfile.lock Pipfile.lock
RUN pipenv install --dev --deploy --system && pyenv rehash
RUN playwright install-deps
RUN playwright install firefox
COPY . .
ARG GIT_COMMIT
ENV GIT_COMMIT=$GIT_COMMIT
CMD ["/home/ubuntu/ci/run_all_spiders.sh"]