-
Notifications
You must be signed in to change notification settings - Fork 123
/
Dockerfile-for-github-action
42 lines (33 loc) · 1.05 KB
/
Dockerfile-for-github-action
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
FROM python:3.11.11-slim-bookworm as build
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV SET_CONTAINER_TIMEZONE=true
ENV CONTAINER_TIMEZONE=Asia/Shanghai
ENV TZ=Asia/Shanghai
ARG TARGETARCH
ARG VERSION
ENV VERSION=${VERSION}
ENV PYTHON_IN_DOCKER='PYTHON_IN_DOCKER'
COPY scripts/* /app/
WORKDIR /app
RUN apt-get --allow-releaseinfo-change update \
&& apt-get install -y --no-install-recommends jq chromium chromium-driver tzdata \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone \
&& dpkg-reconfigure --frontend noninteractive tzdata \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
COPY ./requirements.txt /tmp/requirements.txt
RUN mkdir /data \
&& cd /tmp \
&& python3 -m pip install --upgrade pip \
&& PIP_ROOT_USER_ACTION=ignore pip install \
--disable-pip-version-check \
--no-cache-dir \
-r requirements.txt \
&& rm -rf /tmp/* \
&& pip cache purge \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/log/*
ENV LANG=C.UTF-8
CMD ["python3","main.py"]