This commit is contained in:
Womsxd 2022-07-19 16:30:58 +08:00
commit 1c2c5c5ae9
No known key found for this signature in database
GPG Key ID: 0FE76418EE689B68
5 changed files with 55 additions and 21 deletions

View File

@ -1,10 +1,9 @@
FROM python:3-alpine
LABEL maintainer="mailto@wolfbolin.com"
LABEL maintainer="x.yangtze.river@gmail.com"
ENV CRON_SIGNIN='30 9 * * *'
ENV MULTI=TRUE
ENV TZ=Asia/Shanghai
RUN adduser app -D
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
&& apk add --no-cache tzdata
@ -12,7 +11,6 @@ WORKDIR /tmp
ADD requirements.txt ./
RUN pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
USER app
WORKDIR /var/app
COPY . /var/app

18
Dockerfile.arm32v6 Normal file
View File

@ -0,0 +1,18 @@
FROM arm32v6/python:3-alpine
COPY qemu-arm-static /usr/bin/
LABEL maintainer="x.yangtze.river@gmail.com"
ENV CRON_SIGNIN='30 9 * * *'
ENV MULTI=TRUE
ENV TZ=Asia/Shanghai
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
&& apk add --no-cache tzdata
WORKDIR /tmp
ADD requirements.txt ./
RUN pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
WORKDIR /var/app
COPY . /var/app
CMD ["python3", "./docker.py" ]

18
Dockerfile.arm32v7 Normal file
View File

@ -0,0 +1,18 @@
FROM arm32v7/python:3-alpine
COPY qemu-arm-static /usr/bin/
LABEL maintainer="x.yangtze.river@gmail.com"
ENV CRON_SIGNIN='30 9 * * *'
ENV MULTI=TRUE
ENV TZ=Asia/Shanghai
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
&& apk add --no-cache tzdata
WORKDIR /tmp
ADD requirements.txt ./
RUN pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
WORKDIR /var/app
COPY . /var/app
CMD ["python3", "./docker.py" ]

18
Dockerfile.arm64v8 Normal file
View File

@ -0,0 +1,18 @@
FROM arm64v8/python:3-alpine
COPY qemu-arm-static /usr/bin/
LABEL maintainer="x.yangtze.river@gmail.com"
ENV CRON_SIGNIN='30 9 * * *'
ENV MULTI=TRUE
ENV TZ=Asia/Shanghai
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories \
&& apk add --no-cache tzdata
WORKDIR /tmp
ADD requirements.txt ./
RUN pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
WORKDIR /var/app
COPY . /var/app
CMD ["python3", "./docker.py" ]

View File

@ -1,18 +0,0 @@
#!/bin/bash
docker_name="mihoyo-bbs"
docker stop ${docker_name}
docker rm ${docker_name}
echo -e "\033[5;36mOrz 旧容器(镜像)已清理\033[0m"
time_now=$(date "+%m%d%H")
docker build -f Dockerfile --tag ${docker_name}:"${time_now}" .
echo -e "\033[5;36mOrz 镜像重建完成\033[0m"
docker run -itd \
--name ${docker_name} \
--log-opt max-size=1m \
-v $(pwd):/var/app \
${docker_name}:"${time_now}"
echo -e "\033[5;36mOrz 镜像启动完成\033[0m"
docker ps -a
docker logs ${docker_name} -f