-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build Mongodb-backup Image and store backup in aws s3 and azure storage
- Loading branch information
Deepak Tiwari
committed
Aug 9, 2023
1 parent
e26f170
commit 6153315
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM ubuntu:22.04@sha256:965fbcae990b0467ed5657caceaec165018ef44a4d2d46c7cdea80a9dff0d1ea | ||
|
||
RUN apt-get -y update && apt-get -y install --no-install-recommends python3 python3-pymongo curl wget awscli gcc musl-dev python3-dev libffi-dev cargo make pip | ||
|
||
RUN wget https://fastdl.mongodb.org/tools/db/mongodb-database-tools-ubuntu2204-x86_64-100.6.1.deb -O /tmp/mongodb-tools.deb && \ | ||
dpkg -i /tmp/mongodb-tools.deb && \ | ||
rm /tmp/mongodb-tools.deb | ||
|
||
RUN pip install --upgrade pip | ||
RUN pip install azure-cli | ||
RUN mkdir /backup /tiw | ||
|
||
ENV S3_PATH=mongodb AWS_DEFAULT_REGION=us-east-1 | ||
|
||
COPY ./mongodb-backup/script/entrypoint.sh /usr/local/bin/entrypoint | ||
COPY ./mongodb-backup/script/backup.sh /usr/local/bin/backup | ||
COPY ./mongodb-backup/script/mongouri.py /usr/local/bin/mongouri | ||
|
||
RUN chmod 775 /usr/local/bin/entrypoint | ||
RUN chmod 775 /usr/local/bin/backup | ||
RUN chmod 775 /usr/local/bin/mongouri | ||
|
||
VOLUME /backup | ||
|
||
CMD /usr/local/bin/entrypoint |