Skip to content

Commit

Permalink
fix: 修复无法构建docker镜像的问题 (#198)
Browse files Browse the repository at this point in the history
* fix: 修复无法构建docker镜像的问题

* Update Dockerfile
  • Loading branch information
Night-stars-1 authored Nov 23, 2023
1 parent bd08042 commit 23360a6
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 511 deletions.
14 changes: 3 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,16 @@ FROM python:alpine

RUN apk add --no-cache gcc musl-dev python3-dev libffi-dev

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

RUN curl -sSL https://pdm-project.org/install-pdm.py | python3 -

ENV PATH="/root/.local/bin:$PATH"
RUN pip install --no-cache-dir pdm

WORKDIR /srv

COPY ./utils ./utils

COPY ./pyproject.toml ./miuitask.py ./
COPY ./pyproject.toml ./pdm.lock ./miuitask.py ./

RUN pdm install --prod

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 -

RUN apk del .build-app

VOLUME ["./data", "/srv/data"]

CMD ["/usr/sbin/crond", "-f"]
CMD ["pdm", "run", "python", "miuitask.py"]
31 changes: 0 additions & 31 deletions Dockerfile-cn

This file was deleted.

Loading

0 comments on commit 23360a6

Please sign in to comment.