aboutsummaryrefslogtreecommitdiff
path: root/docker/auto-backup/Dockerfile
blob: c7ff4fc44e8c69225e19369abe1e92d611dddb51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
COPY AutoBackup /AutoBackup
WORKDIR /AutoBackup
RUN dotnet publish AutoBackup.csproj --configuration Release --output ./publish/ -r linux-x64 --self-contained false

FROM mcr.microsoft.com/dotnet/runtime:9.0-alpine
RUN apk add --no-cache tini coreutils bash tar xz
ARG CRUPEST_AUTO_BACKUP_INIT_DELAY=0
ARG CRUPEST_AUTO_BACKUP_INTERVAL=1d
ARG CRUPEST_AUTO_BACKUP_COS_SECRET_ID
ARG CRUPEST_AUTO_BACKUP_COS_SECRET_KEY
ARG CRUPEST_AUTO_BACKUP_COS_REGION
ARG CRUPEST_AUTO_BACKUP_BUCKET_NAME
ENV CRUPEST_AUTO_BACKUP_INIT_DELAY=${CRUPEST_AUTO_BACKUP_INIT_DELAY}
ENV CRUPEST_AUTO_BACKUP_INTERVAL=${CRUPEST_AUTO_BACKUP_INTERVAL}
ENV CRUPEST_AUTO_BACKUP_COS_SECRET_ID=${CRUPEST_AUTO_BACKUP_COS_SECRET_ID}
ENV CRUPEST_AUTO_BACKUP_COS_SECRET_KEY=${CRUPEST_AUTO_BACKUP_COS_SECRET_KEY}
ENV CRUPEST_AUTO_BACKUP_COS_REGION=${CRUPEST_AUTO_BACKUP_COS_REGION}
ENV CRUPEST_AUTO_BACKUP_BUCKET_NAME=${CRUPEST_AUTO_BACKUP_BUCKET_NAME}
VOLUME [ "/data" ]
COPY daemon.bash /daemon.bash
COPY --from=build /AutoBackup/publish /AutoBackup
ENTRYPOINT ["tini", "--"]
CMD [ "/daemon.bash" ]