aliyunpan/docker/sync/Dockerfile

68 lines
1.9 KiB
Docker
Raw Normal View History

2022-06-13 23:28:06 +08:00
# alpine:3.15.0
# 参数
ARG DOCKER_IMAGE_HASH
FROM alpine@sha256:$DOCKER_IMAGE_HASH
LABEL author="tickstep"
LABEL email="tickstep@outlook.com"
LABEL version="1.0"
LABEL description="sync & backup service for aliyun cloud drive"
# 时区
ENV TZ=Asia/Shanghai
# 手动下载tzdata安装包注意要下载对应架构的 https://dl-cdn.alpinelinux.org/alpine/v3.15/community/
RUN apk add -U tzdata
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# 创建运行目录
RUN mkdir -p /home/app
VOLUME /home/app
WORKDIR /home/app
RUN cd /home/app
# 创建配置文件目录
2022-06-16 08:53:17 +08:00
RUN mkdir -p /home/app/config
2022-06-13 23:28:06 +08:00
# 创建数据文件夹
2022-06-16 08:53:17 +08:00
RUN mkdir -p /home/app/data
2022-06-13 23:28:06 +08:00
RUN chmod 777 /home/app/data
# 复制文件
COPY ./docker/sync/app.sh /home/app/app.sh
RUN chmod +x /home/app/app.sh
2022-06-16 13:47:01 +08:00
COPY ./docker/sync/health_check.sh /home/app/health_check.sh
RUN chmod +x /home/app/health_check.sh
2022-06-13 23:28:06 +08:00
COPY ./out/binary_files/aliyunpan /home/app
2022-06-16 08:53:17 +08:00
RUN mkdir -p /home/app/config/plugin
2022-06-15 22:33:23 +08:00
COPY ./out/binary_files/plugin /home/app/config/plugin
2022-06-16 08:53:17 +08:00
RUN mkdir -p /home/app/config/sync_drive
2022-06-15 22:33:23 +08:00
COPY ./out/binary_files/sync_drive /home/app/config/sync_drive
2022-06-13 23:28:06 +08:00
#RUN chmod +x /home/app/aliyunpan
2022-06-16 13:47:01 +08:00
# 健康检查
HEALTHCHECK --start-period=5s --interval=10s --timeout=5s --retries=3 CMD /bin/sh /home/app/health_check.sh
2022-06-13 23:28:06 +08:00
# 环境变量
ENV ALIYUNPAN_DOCKER=1
2022-06-13 23:28:06 +08:00
ENV ALIYUNPAN_CONFIG_DIR=/home/app/config
ENV ALIYUNPAN_DOWNLOAD_PARALLEL=2
ENV ALIYUNPAN_UPLOAD_PARALLEL=2
ENV ALIYUNPAN_DOWNLOAD_BLOCK_SIZE=1024
ENV ALIYUNPAN_UPLOAD_BLOCK_SIZE=10240
ENV ALIYUNPAN_LOCAL_DIR=/home/app/data
ENV ALIYUNPAN_PAN_DIR=/sync_drive
ENV ALIYUNPAN_SYNC_MODE=upload
ENV ALIYUNPAN_SYNC_POLICY=increment
2024-03-17 15:53:28 +08:00
ENV ALIYUNPAN_SYNC_DRIVE=backup
2024-04-21 18:43:01 +08:00
ENV ALIYUNPAN_SYNC_CYCLE=infinity
2022-08-13 18:43:29 +08:00
ENV ALIYUNPAN_SYNC_PRIORITY=time
2022-08-13 19:38:10 +08:00
ENV ALIYUNPAN_SYNC_LOG=false
2022-09-29 19:48:25 +08:00
ENV ALIYUNPAN_LOCAL_DELAY_TIME=3
2024-09-20 11:04:21 +08:00
ENV ALIYUNPAN_SCAN_INTERVAL_TIME=1
2023-02-19 17:04:45 +08:00
ENV ALIYUNPAN_DEVICE_ID=""
2022-06-13 23:28:06 +08:00
# 运行
ENTRYPOINT ./app.sh