This repository has been archived by the owner on May 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
43 lines (37 loc) · 1.77 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM python:3.7-slim-buster
LABEL maintainer="AzurCrystal"
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
WORKDIR /home/yobot
EXPOSE 9222
VOLUME /home/yobot/yobot
ENTRYPOINT /home/yobot/entry.sh