add mongo backup
parent
c75da3c383
commit
2bf380260c
|
@ -10,7 +10,7 @@ RUN apt update && apt install -y curl unzip && \
|
|||
tar xf mongodump.tgz -C /usr/local && \
|
||||
rm -rf aws awscliv2.zip mongodump.tgz
|
||||
|
||||
ENV PATH=$PATH:/usr/local/mongodump/bin DATABASES="" HOST="" PORT="" PASSWORD=""
|
||||
ENV PATH=$PATH:/usr/local/mongodump/bin DATABASES="" HOST="" PORT="" PASSWORD="" AWS_ACCESS_KEY="" AWS_SECRET_KEY=""
|
||||
COPY entrypoint.sh /usr/local/bin
|
||||
|
||||
CMD [ "/usr/local/bin/entrypoint.sh" ]
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
datetime=`date +%Y%m%d%H`
|
||||
|
||||
mkdir -p ~/.aws
|
||||
|
||||
echo -ne "[default]\naws_access_key_id = ${AWS_ACCESS_KEY}\naws_secret_access_key = ${AWS_SECRET_KEY}\n" > ~/.aws/credentials
|
||||
|
||||
dbs=($DATABASES)
|
||||
|
||||
for db in "${dbs[@]}"
|
||||
|
|
Loading…
Reference in New Issue