diff --git a/projects/fangjia-script/Dockerfile b/projects/fangjia-script/Dockerfile index a080b6443..5468308b0 100644 --- a/projects/fangjia-script/Dockerfile +++ b/projects/fangjia-script/Dockerfile @@ -1,21 +1,19 @@ FROM 192.168.0.19:9010/eclipse-temurin:8-jre ENV TZ=Asia/Shanghai -RUN find /etc/apt -name "*.list" -o -name "*.sources" | \ - xargs sed -i \ - 's|http://archive.ubuntu.com|http://mirrors.aliyun.com|g; \ - s|http://security.ubuntu.com|http://mirrors.aliyun.com|g' && \ - apt-get update && apt-get install -y --no-install-recommends wget tzdata && \ - wget -q "https://github.com/aptible/supercronic/releases/download/v0.2.29/supercronic-linux-amd64" \ - -O /usr/local/bin/supercronic && \ - chmod +x /usr/local/bin/supercronic && \ - rm -rf /var/lib/apt/lists/* -# 对齐线上部署路径,/home/goojia/bin/*.sh 中的 cd 路径无需改动 + +# supercronic 本地 COPY,不依赖外网 +COPY supercronic /usr/local/bin/supercronic +RUN chmod +x /usr/local/bin/supercronic + WORKDIR /home/goojia/webapps/fangjia-script -# 构建产物:.groovy 脚本 + lib/*.jar(含 groovy-all.jar,无需单独安装 Groovy) + COPY target/classes/ . COPY run.sh . RUN chmod +x run.sh + RUN mkdir -p /home/goojia/logs + COPY crontab.txt /app/crontab -CMD ["supercronic", "/app/crontab"] + +CMD ["supercronic", "/app/crontab"] \ No newline at end of file diff --git a/projects/fangjia-script/supercronic b/projects/fangjia-script/supercronic new file mode 100644 index 000000000..91b0a4098 Binary files /dev/null and b/projects/fangjia-script/supercronic differ