Skip to content

Commit bd08042

Browse files
authored
remove pdm.lock and mirror settings in Dockerfile (#195)
create Dockerfile-cn for China users
1 parent 31ff695 commit bd08042

2 files changed

Lines changed: 32 additions & 7 deletions

File tree

Dockerfile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
FROM python:alpine
22

3-
RUN sed -i 's|https://dl-cdn.alpinelinux.org|http://mirrors.tuna.tsinghua.edu.cn|g' /etc/apk/repositories
4-
53
RUN apk add --no-cache gcc musl-dev python3-dev libffi-dev
64

75
RUN apk add --no-cache --virtual .build-app curl
86

9-
RUN pip config set global.index-url 'https://mirrors.sustech.edu.cn/pypi/web/simple'
10-
117
RUN curl -sSL https://pdm-project.org/install-pdm.py | python3 -
128

139
ENV PATH="/root/.local/bin:$PATH"
1410

15-
RUN pdm config pypi.url 'https://mirrors.sustech.edu.cn/pypi/web/simple'
16-
1711
WORKDIR /srv
1812

1913
COPY ./utils ./utils
2014

21-
COPY ./pyproject.toml ./pdm.lock ./miuitask.py ./
15+
COPY ./pyproject.toml ./miuitask.py ./
2216

2317
RUN pdm install --prod
2418

Dockerfile-cn

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM python:alpine
2+
3+
RUN sed -i 's|https://dl-cdn.alpinelinux.org|http://mirrors.tuna.tsinghua.edu.cn|g' /etc/apk/repositories
4+
5+
RUN apk add --no-cache gcc musl-dev python3-dev libffi-dev
6+
7+
RUN apk add --no-cache --virtual .build-app curl
8+
9+
RUN pip config set global.index-url 'https://mirrors.sustech.edu.cn/pypi/web/simple'
10+
11+
RUN curl -sSL https://pdm-project.org/install-pdm.py | python3 -
12+
13+
ENV PATH="/root/.local/bin:$PATH"
14+
15+
RUN pdm config pypi.url 'https://mirrors.sustech.edu.cn/pypi/web/simple'
16+
17+
WORKDIR /srv
18+
19+
COPY ./utils ./utils
20+
21+
COPY ./pyproject.toml ./miuitask.py ./
22+
23+
RUN pdm install --prod
24+
25+
RUN { crontab -l; printf '%s\t%s\t%s\t%s\t%s\t%s\n' '0' '4' '*' '*' '*' '/usr/bin/env pdm run python /srv/miuitask.py'; } | crontab -
26+
27+
RUN apk del .build-app
28+
29+
VOLUME ["./data", "/srv/data"]
30+
31+
CMD ["/usr/sbin/crond", "-f"]

0 commit comments

Comments
 (0)