mirror of
https://github.com/tickstep/aliyunpan.git
synced 2025-01-23 14:32:14 +08:00
add health check for sync docker
This commit is contained in:
parent
3ef5e67d76
commit
1d8e16f5c9
@ -31,6 +31,8 @@ RUN chmod 777 /home/app/data
|
|||||||
# 复制文件
|
# 复制文件
|
||||||
COPY ./docker/sync/app.sh /home/app/app.sh
|
COPY ./docker/sync/app.sh /home/app/app.sh
|
||||||
RUN chmod +x /home/app/app.sh
|
RUN chmod +x /home/app/app.sh
|
||||||
|
COPY ./docker/sync/health_check.sh /home/app/health_check.sh
|
||||||
|
RUN chmod +x /home/app/health_check.sh
|
||||||
|
|
||||||
COPY ./out/binary_files/aliyunpan /home/app
|
COPY ./out/binary_files/aliyunpan /home/app
|
||||||
RUN mkdir -p /home/app/config/plugin
|
RUN mkdir -p /home/app/config/plugin
|
||||||
@ -39,6 +41,9 @@ RUN mkdir -p /home/app/config/sync_drive
|
|||||||
COPY ./out/binary_files/sync_drive /home/app/config/sync_drive
|
COPY ./out/binary_files/sync_drive /home/app/config/sync_drive
|
||||||
#RUN chmod +x /home/app/aliyunpan
|
#RUN chmod +x /home/app/aliyunpan
|
||||||
|
|
||||||
|
# 健康检查
|
||||||
|
HEALTHCHECK --start-period=5s --interval=10s --timeout=5s --retries=3 CMD /bin/sh /home/app/health_check.sh
|
||||||
|
|
||||||
# 环境变量
|
# 环境变量
|
||||||
ENV ALIYUNPAN_CONFIG_DIR=/home/app/config
|
ENV ALIYUNPAN_CONFIG_DIR=/home/app/config
|
||||||
|
|
||||||
|
13
docker/sync/health_check.sh
Normal file
13
docker/sync/health_check.sh
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# 检查aliyunpan进程是否存在
|
||||||
|
ps | awk '{print $4}' | grep aliyunpan
|
||||||
|
if [ $? == 0 ]
|
||||||
|
then
|
||||||
|
echo $?
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo $?
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user