Skip to content

Commit 60fbac3

Browse files
authored
Merge pull request #6 from P-T-I/master
Work around file limits
2 parents 074c85f + e006a25 commit 60fbac3

File tree

9 files changed

+36
-1
lines changed

9 files changed

+36
-1
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# This script is used to automatically extract a dump from a local running instance of cve_search, 7zip it, and cut the
4+
# 7z archive into 50M pieces
5+
6+
mongodump -d cvedb --gzip
7+
8+
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on db_dump.7z ./dump
9+
10+
split -b 50M db_dump.7z "db_dump_part"
11+
12+
rm -rf ./dump
13+
rm -rf ./db_dump.7z
50 MB
Binary file not shown.
50 MB
Binary file not shown.
50 MB
Binary file not shown.
37.7 MB
Binary file not shown.

docker/files/mongodb/install.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,13 @@
22

33
echo "Running install script..."
44

5+
cat /install/db_dump_part* > /install/db_dump.7z
6+
7+
rm -rf /install/db_dump_part*
8+
9+
7z x /install/db_dump.7z
10+
511
mongorestore --gzip -v /install/dump
12+
13+
rm -rf /install/db_dump.7z
14+
rm -rf /install/dump

docker/images/cve_search/dockerfile-cve_search

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ RUN pip install -r requirements.txt
1717

1818
COPY ./docker/files/cve_search/install.sh .
1919

20+
RUN ["chmod", "+x", "./install.sh"]
21+
2022
COPY ./docker/files/cve_search/configuration.ini ./etc/configuration.ini
2123

2224
RUN ./install.sh

docker/images/mongodb/dockerfile-mongo

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ ENV APP /install
99
RUN mkdir $APP
1010
WORKDIR $APP
1111

12+
RUN apt-get update
13+
RUN apt-get install -y p7zip-full
14+
1215
COPY ./docker/files/mongodb/install.sh /docker-entrypoint-initdb.d/install.sh
13-
COPY ./docker/files/mongodb/dump ./dump
16+
17+
RUN ["chmod", "+x", "/docker-entrypoint-initdb.d/install.sh"]
18+
19+
COPY ./docker/files/mongodb/db_dump_part* ./
20+
21+
RUN ["chown", "mongodb:", "-R", "/install"]
1422

1523
EXPOSE 27017

docker/images/redis/dockerfile-redis

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ RUN mkdir $APP
1010
WORKDIR $APP
1111

1212
COPY ./docker/files/redis/install.sh .
13+
14+
RUN ["chmod", "+x", "./install.sh"]
15+
1316
COPY ./docker/files/redis/dump.rdb .
1417

1518
RUN ./install.sh

0 commit comments

Comments
 (0)