forked from alltheplaces/alltheplaces
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
67 lines (57 loc) · 1.63 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
FROM ubuntu:22.04
# This is from https://hub.docker.com/r/yahwang/ubuntu-pyenv/dockerfile
ARG PYTHON_VERSION=3.10
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 -y --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 pyenv & python
RUN curl https://pyenv.run | bash \
&& pyenv install ${PYTHON_VERSION} \
&& pyenv global ${PYTHON_VERSION} \
&& pip install --upgrade pip pipenv
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 . .
CMD ["/home/ubuntu/ci/run_all_spiders.sh"]