From d3a0da3d9f78dc753008f3fc421cd1cb1463c29d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kotori=E3=81=AE=E3=81=AD=E3=81=93?= <2567702743@qq.com> Date: Thu, 27 Oct 2022 07:13:57 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Add=20docker=20integration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 18 ++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..441cfaf --- /dev/null +++ b/.dockerignore @@ -0,0 +1,60 @@ +### Code Editor ### + +# VSCode +.vscode/ +*.code-workspace +.history +.ionide + +# Pycharm +*.iws +.idea/ +out/ + +### Python ### + +# Environments +env/ +venv/ +cache/ +temp/ + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class +*.pyo +*.pyc + +### Customize ### + +**_test.html +test_**.html +logs/ +report/ +data/ +/resources/*/*/test/ +plugins/genshin/daily/daily.json +metadata/data/ +resources/assets/ + +### DotEnv ### +.env + + +### private plugins ### +plugins/private + + +# Unit test / coverage reports +.pytest_cache + +### mtp ### +paimon.session +PaimonBot.session +PaimonBot.session-journal + + +### git ### +.git +.gitignore \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c86a5da --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM python:3.10.8-slim-bullseye +COPY . /app +WORKDIR /app +RUN pip install virtualenv==20.16.6 poetry==1.2.2 \ + && python3 -m virtualenv venv/ \ + && . venv/bin/activate \ + && poetry install \ + && playwright install chromium \ + && playwright install-deps \ + && apt install -y git \ + && git init . \ + && git add -A \ + && git -c user.name='user' \ + -c user.email='user@example.com' \ + commit -m 'Docker deployment' \ + && mkdir cache/ \ + && rm -rf /var/lib/apt/lists/* +ENTRYPOINT ["venv/bin/python", "./run.py"]