-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀 新增Docker部署脚本 (#11) (KimigaiiWuyi/GenshinUID#538)
* 新增Docker部署脚本 * 🚨 `pre-commit-ci`修复格式错误 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
3064e17
commit 2ca3b90
Showing
4 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
__pycache__ | ||
./gsuid-core/data/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM python:3.8.12-slim | ||
|
||
WORKDIR /app/gsuid_core | ||
|
||
ENV PATH="${PATH}:/root/.local/bin" | ||
|
||
ADD ./ /app/ | ||
|
||
RUN mv /etc/apt/sources.list /etc/apt/sources.list.bak \ | ||
&& echo "deb http://ftp.cn.debian.org/debian/ bullseye main non-free contrib" >/etc/apt/sources.list \ | ||
&& echo "deb http://ftp.cn.debian.org/debian/ bullseye-updates main non-free contrib" >>/etc/apt/sources.list \ | ||
&& echo "deb http://ftp.cn.debian.org/debian/ bullseye-backports main non-free contrib" >>/etc/apt/sources.list \ | ||
&& echo "deb-src http://ftp.cn.debian.org/debian/ bullseye main non-free contrib" >>/etc/apt/sources.list \ | ||
&& echo "deb-src http://ftp.cn.debian.org/debian/ bullseye-updates main non-free contrib" >>/etc/apt/sources.list \ | ||
&& echo "deb-src http://ftp.cn.debian.org/debian/ bullseye-backports main non-free contrib" >>/etc/apt/sources.list \ | ||
&& echo "deb http://mirrors.ustc.edu.cn/debian-security/ stable-security main non-free contrib" >>/etc/apt/sources.list \ | ||
&& echo "deb-src http://mirrors.ustc.edu.cn/debian-security/ stable-security main non-free contrib" >>/etc/apt/sources.list \ | ||
&& rm -rf /var/lib/apt/lists/* && apt-get update | ||
|
||
RUN apt install curl git -y | ||
|
||
RUN /usr/local/bin/python -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple | ||
|
||
RUN /usr/local/bin/python -m pip install --no-cache-dir --upgrade --quiet pip | ||
|
||
RUN /usr/local/bin/python -m pip install poetry | ||
|
||
RUN poetry install && rm -rf /app/* | ||
|
||
CMD poetry run python3 core.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
services: | ||
gsuid-core: | ||
build: . | ||
container_name: gsuidcore | ||
restart: always | ||
environment: | ||
- TZ=Asia/Shanghai | ||
dns: | ||
- 114.114.114.114 | ||
- 114.114.115.115 | ||
ports: | ||
- 8765:8765 | ||
volumes: | ||
- ${PWD}:/app |