-
Notifications
You must be signed in to change notification settings - Fork 41
/
Dockerfile
34 lines (27 loc) · 1.05 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
FROM python:3.8-slim-buster as build
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
WORKDIR /app
COPY scripts/* /app/
COPY ./requirements.txt /tmp/requirements.txt
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list \
&& apt-get --allow-releaseinfo-change update \
&& apt-get install -y --no-install-recommends jq chromium chromium-driver tzdata\
&& ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& dpkg-reconfigure --frontend noninteractive tzdata \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
RUN cd /tmp \
&& pip config --global set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple \
&& pip config --global set install.trusted-host pypi.tuna.tsinghua.edu.cn \
&& 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 ["python"]