Skip to content

Commit

Permalink
build: Use postgresql dump files
Browse files Browse the repository at this point in the history
  • Loading branch information
kesara committed Oct 2, 2024
1 parent 61dc5ba commit 4973757
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ So the only requirement to run it locally is a recent version of Docker with doc

##### How to run (with a database dump)

1. Obtain a recent database dump with name like `ietfa.*.gz` and place in `docker/database/` directory. Otherwise, it will start with a fresh database.
1. Obtain a recent database dump with name like `ietf*.dump` and place in `docker/database/` directory. Otherwise, it will start with a fresh database.
2. Obtain and unarchive media files into `media/` folder.
3. Run `docker compose up`. It will build and start the frontend builder (`yarn run start`) and the backend (`python manage.py runserver` analog), along with a Postgresql database. The first run will take a while because the database dump needs to be restored.
4. After the frontend compilation finishes, the website should become available at http://localhost:8001
Expand Down
8 changes: 1 addition & 7 deletions docker/database/02_convert_native_dump_to_sql_and_restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
cd /docker-entrypoint-initdb.d

set +e
FILE=$(ls -1 ietfa.*.gz | head)
FILE=$(ls -1 *.dump | head)

set -e

Expand All @@ -16,13 +16,7 @@ restore_dump() {
}

if [ -s "${FILE}" ]; then
echo "Found ${FILE}, converting..."
case $FILE in
*.gz)
echo "Restoring the gzipped archive..."
gzip -d -c $FILE | restore_dump
;;
*)
echo "Restoring the archive..."
cat $FILE | restore_dump
;;
Expand Down

0 comments on commit 4973757

Please sign in to comment.