-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Dockerfile
68 lines (63 loc) · 2.6 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
# getter < https://t.me/kastaid >
# Copyright (C) 2022-present kastaid
#
# This file is a part of < https://github.com/kastaid/getter/ >
# Please read the GNU Affero General Public License in
# < https://github.com/kastaid/getter/blob/main/LICENSE/ >.
FROM python:3.12-slim-bookworm
ENV TZ=Asia/Jakarta \
TERM=xterm-256color \
DEBIAN_FRONTEND=noninteractive \
VIRTUAL_ENV=/opt/venv \
PATH=/opt/venv/bin:/app/bin:$PATH \
CHROME_BIN=/usr/bin/google-chrome \
DISPLAY=:99
ARG LANG=en_US
WORKDIR /app
COPY . .
RUN set -ex \
&& apt-get -qqy update \
&& apt-get -qqy install --no-install-recommends \
gnupg \
git \
curl \
wget \
tree \
neofetch \
fonts-roboto \
fonts-hack-ttf \
fonts-noto-color-emoji \
locales \
tzdata \
ffmpeg \
cairosvg \
libjpeg-dev \
libpng-dev \
libnss3 \
unzip \
build-essential \
&& localedef --quiet -i ${LANG} -c -f UTF-8 -A /usr/share/locale/locale.alias ${LANG}.UTF-8 \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& dpkg-reconfigure --force -f noninteractive tzdata >/dev/null 2>&1 \
&& install -m 0755 -d /etc/apt/keyrings \
&& curl -fsSL https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /etc/apt/keyrings/google-chrome.gpg \
&& chmod a+r /etc/apt/keyrings/google-chrome.gpg \
&& echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google-chrome.list > /dev/null \
&& apt-get -qqy update \
&& apt-get -qqy install --no-install-recommends google-chrome-stable \
&& wget -qN https://chromedriver.storage.googleapis.com/$(curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE)/chromedriver_linux64.zip -P ~/ \
&& unzip -qq ~/chromedriver_linux64.zip -d ~/ \
&& rm -rf ~/chromedriver_linux64.zip \
&& mv -f ~/chromedriver /usr/bin/chromedriver \
&& chmod +x /usr/bin/chromedriver \
&& command -v chromedriver \
&& $(command -v chromedriver) --version \
&& cp -rf .config ~/ \
&& python3 -m venv $VIRTUAL_ENV \
&& pip3 install --disable-pip-version-check --default-timeout=100 -r requirements.txt \
&& apt-get -qqy purge --auto-remove \
unzip \
build-essential \
&& apt-get -qqy clean \
&& rm -rf -- /var/lib/apt/lists/* /var/cache/apt/archives/* /etc/apt/sources.list.d/* /usr/share/man/* /usr/share/doc/* /var/log/* /tmp/* /var/tmp/*
CMD ["python3", "-m", "getter"]