From 17394ade447dc9c22096e0e6caa1d1f14c2d3341 Mon Sep 17 00:00:00 2001 From: ZSYTY <793533676@qq.com> Date: Tue, 31 Oct 2023 10:16:43 +0800 Subject: [PATCH] fix Dockerfile --- docker/Dockerfile | 21 +++++++++++++++++++++ docker/etc/log_cleaner | 2 ++ 2 files changed, 23 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index e69de29bb..38fe9c79e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -0,0 +1,21 @@ +FROM polardbx/polardbxbasejava:20221129 + +WORKDIR /home/admin + +COPY polardbx-server/target/polardbx-server drds-server +COPY docker/admin/bin/* /home/admin/bin/ +COPY docker/etc/* /tmp/ +COPY docker/entrypoint.sh entrypoint.sh + +RUN \ + chmod a+x bin/* && \ + chmod a+x entrypoint.sh && \ + chown admin:admin -R /home/admin && \ + cp /tmp/drds /etc/logrotate.d/drds && \ + cp /tmp/log_cleaner /etc/cron.d/log_cleaner && \ + true + +USER admin + +# Set command to entrypoint.sh +ENTRYPOINT /home/admin/entrypoint.sh diff --git a/docker/etc/log_cleaner b/docker/etc/log_cleaner index e69de29bb..1e1088087 100644 --- a/docker/etc/log_cleaner +++ b/docker/etc/log_cleaner @@ -0,0 +1,2 @@ +*/1 * * * * root /home/admin/bin/log_cleaner.sh 90 >/dev/null 2>&1 +