From 9ecd7771b0f4e99a5d3c807504d87481fcc9f51e Mon Sep 17 00:00:00 2001 From: 1-6 Date: Wed, 9 Aug 2023 13:57:40 +0800 Subject: [PATCH] x --- .dockerfile | 51 ++++++++++++++++------------------------------ core/grpc_asset.go | 5 ++++- 2 files changed, 21 insertions(+), 35 deletions(-) diff --git a/.dockerfile b/.dockerfile index d3ec74f..e1b8b04 100644 --- a/.dockerfile +++ b/.dockerfile @@ -1,54 +1,35 @@ -# 使用Alpine镜像作为基础镜像 -FROM alpine:latest +# 使用Debian镜像作为基础镜像 +FROM debian:11 -# 将APK源更换为国内源(这里使用阿里云的源) -RUN echo "https://mirrors.aliyun.com/alpine/latest-stable/main" > /etc/apk/repositories && \ - echo "https://mirrors.aliyun.com/alpine/latest-stable/community" >> /etc/apk/repositories +# 将APT源更换为国内源(这里使用阿里云的源) +RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list && \ + sed -i 's/security.debian.org/mirrors.aliyun.com\/debian-security/g' /etc/apt/sources.list # 更新软件包索引并安装必要的工具 -RUN apk update && apk add --no-cache \ +RUN apt-get update && apt-get install -y \ python3 \ - py3-pip \ + python3-pip \ php \ php-json \ - php-phar \ - php-openssl \ - php-pdo \ - php-mysqli \ - php-session \ - php-ctype \ - php-tokenizer \ - php-dom \ php-xml \ - php-xmlwriter \ php-mbstring \ - php-simplexml \ - php-fileinfo \ - php-opcache \ - php-zlib \ php-curl \ - php-ftp \ php-gd \ - php-xmlreader \ - php-pdo_mysql \ - php-pdo_sqlite \ - php-pdo_pgsql \ - php-posix \ - php-sockets \ - php-bcmath \ + php-zip \ + php-mysql \ + php-pgsql \ php-redis \ php-pear \ php-dev \ - php-pear-grpc \ curl \ wget \ git # 安装gRPC扩展 -RUN pecl install grpc +# RUN pecl install grpc # 清理缓存和临时文件 -RUN rm -rf /tmp/* /var/cache/apk/* +RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # 下载文件 RUN mkdir -p /usr/local/sillyGirl \ @@ -72,10 +53,12 @@ RUN mkdir -p /usr/local/sillyGirl \ # 设置工作目录 WORKDIR /usr/local/sillyGirl - -ENV PATH="/usr/local/sillyGirl/language/node/yarn:${PATH}" +ENV PATH="/usr/local/sillyGirl/language/node/yarn/bin:${PATH}" ENV PATH="/usr/local/sillyGirl/language/node:${PATH}" ENV SILLYGIRL_DATA_PATH=/usr/local/sillyGirl/ # 指定容器启动时要运行的命令 -CMD ["/usr/local/sillyGirl/sillyGirl"] \ No newline at end of file +CMD ["/usr/local/sillyGirl/sillyGirl", "-t"] + +# docker build -t my-sillygirl . +# docker run -d --restart always --name my-sillygirl my-sillygirl diff --git a/core/grpc_asset.go b/core/grpc_asset.go index a4a6377..d6f8fd7 100644 --- a/core/grpc_asset.go +++ b/core/grpc_asset.go @@ -88,7 +88,10 @@ func initLanguage() { } defer os.Remove(zipfile) err = unzip(zipfile, 0777, false) - fmt.Println(err, 4) + if err != nil { + fmt.Println(err, 4) + return + } }() } }