File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11FROM python:alpine
22
3- RUN sed -i 's|https://dl-cdn.alpinelinux.org|http://mirrors.tuna.tsinghua.edu.cn|g' /etc/apk/repositories
4-
53RUN apk add --no-cache gcc musl-dev python3-dev libffi-dev
64
75RUN 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-
117RUN curl -sSL https://pdm-project.org/install-pdm.py | python3 -
128
139ENV PATH="/root/.local/bin:$PATH"
1410
15- RUN pdm config pypi.url 'https://mirrors.sustech.edu.cn/pypi/web/simple'
16-
1711WORKDIR /srv
1812
1913COPY ./utils ./utils
2014
21- COPY ./pyproject.toml ./pdm.lock ./ miuitask.py ./
15+ COPY ./pyproject.toml ./miuitask.py ./
2216
2317RUN pdm install --prod
2418
Original file line number Diff line number Diff line change 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"]
You can’t perform that action at this time.
0 commit comments