This repository has been archived by the owner on May 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
yuudi
committed
Oct 2, 2020
1 parent
270f4a6
commit 2fbfc3b
Showing
14 changed files
with
131 additions
and
176 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,20 @@ | ||
name: docker-build | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: auto build | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build image | ||
uses: docker/build-push-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_ACCESSTOKEN }} | ||
repository: yobot/yobot | ||
tags: latest,slim |
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 |
---|---|---|
@@ -1,43 +1,23 @@ | ||
FROM python:3.7-slim-buster | ||
LABEL maintainer="AzurCrystal" | ||
LABEL maintainer="yobot" | ||
|
||
ARG PUID=1000 | ||
ENV PYTHONIOENCODING=utf-8 | ||
RUN set -x \ | ||
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ | ||
&& echo 'Asia/Shanghai' >/etc/timezone \ | ||
&& { \ | ||
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free"; \ | ||
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free"; \ | ||
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free"; \ | ||
echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free"; \ | ||
} > /etc/apt/sources.list \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& apt-get clean \ | ||
&& apt-get update \ | ||
&& apt-get install git -y --no-install-recommends --no-install-suggests \ | ||
&& useradd -u $PUID -m yobot \ | ||
&& su yobot -c \ | ||
"mkdir -p /home/yobot \ | ||
&& cd /home/yobot \ | ||
&& git clone https://gitee.com/yobot/yobot.git \ | ||
&& { \ | ||
echo '#!/bin/sh'; \ | ||
echo 'cd /home/yobot/yobot/src/client && python3 /home/yobot/yobot/src/client/main.py && sh /home/yobot/yobot/src/client/yobotg.sh'; \ | ||
} > /home/yobot/entry.sh \ | ||
&& chmod 755 /home/yobot/entry.sh \ | ||
&& chmod +x /home/yobot/entry.sh" \ | ||
&& pip3 install --no-cache-dir -r /home/yobot/yobot/src/client/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple \ | ||
&& apt-get clean autoclean \ | ||
&& apt-get autoremove -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
USER yobot | ||
ADD src/client/ /yobot | ||
|
||
WORKDIR /home/yobot | ||
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ | ||
&& echo 'Asia/Shanghai' >/etc/timezone \ | ||
&& cd /yobot \ | ||
&& useradd yobot \ | ||
&& pip3 install aiocqhttp==0.6.8 Quart==0.6.15 --no-cache-dir \ | ||
&& pip3 install -r requirements.txt --no-cache-dir \ | ||
&& python3 main.py \ | ||
&& chmod +x yobotg.sh | ||
|
||
WORKDIR /yobot | ||
|
||
EXPOSE 9222 | ||
|
||
VOLUME /home/yobot/yobot | ||
VOLUME /yobot/yobot_data | ||
|
||
ENTRYPOINT /home/yobot/entry.sh | ||
ENTRYPOINT /yobot/yobotg.sh |
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 was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.