From 056eaaf60d0c2b4594d1f70b8a8b11b1bc20f023 Mon Sep 17 00:00:00 2001 From: Ching Date: Wed, 7 Feb 2024 20:06:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(Dockerfile,=20.drone.yml,=20requirements.t?= =?UTF-8?q?xt):=20=E5=A2=9E=E5=8A=A0=E4=BE=9D=E8=B5=96=E6=96=87=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=83=A8=E7=BD=B2=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 增加依赖文件,增加部署脚本 Signed-off-by: Ching --- .drone.yml | 20 ++++++++++++++++++++ .gitignore | 1 + Dockerfile | 16 ++++++++++++++++ requirements.txt | 18 ++++++++++++++++++ 4 files changed, 55 insertions(+) create mode 100644 .drone.yml create mode 100644 Dockerfile create mode 100644 requirements.txt diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..ddc168a --- /dev/null +++ b/.drone.yml @@ -0,0 +1,20 @@ +kind: pipeline +type: docker +name: default + +steps: + - name: build-and-push + image: plugins/docker + settings: + username: + from_secret: docker_username + password: + from_secret: docker_password + repo: git.tunpok.com/ching/python-env + registry: git.tunpok.com + tags: latest + +volumes: + - name: dockersock + host: + path: /var/run/docker.sock diff --git a/.gitignore b/.gitignore index 5d381cc..76f0ca4 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ __pycache__/ # Distribution / packaging .Python +.python-version build/ develop-eggs/ dist/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a45124c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +# 使用自定义 Docker Registry 中的官方 Python 镜像作为基础镜像 +FROM git.tunpok.com/python:3.10-alpine + +# 设置工作目录 +WORKDIR /app + +# 将 requirements.txt 复制到容器中 +COPY requirements.txt ./ + +# 安装依赖 +RUN pip install --no-cache-dir -r requirements.txt + +# 将当前目录下的所有文件复制到容器中 +COPY . . + +# 省略 CMD 指令,因为这个镜像是作为基础镜像使用 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..190b820 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,18 @@ +beautifulsoup4==4.12.2 +bleak==0.21.1 +bs4==0.0.1 +Flask==3.0.0 +ipdb==0.13.13 +ipython==8.17.2 +jedi==0.19.1 +Jinja2==3.1.2 +loguru==0.7.2 +Mastodon.py==1.8.1 +numpy==1.26.1 +peewee==3.17.0 +Pillow==10.1.0 +PyYAML==6.0.1 +reportlab==4.0.7 +requests==2.31.0 +redis==4.6.0 +sqlite-web==0.6.3