Open tds455 opened 7 months ago
I have added a file - restoredb.sh.
This will configure a psql container and restore the latest backup of the prod database.
Next step will be to automatically create daily backups of prod db.
To use this file a DB_PW environment variable must be set with the current DB password
Well done with the script, This will make the local dev setup more smooth. I did run into some issues on my end though, so I refactored the script a bit to handle errors and provide messages for each step.
Updated to do: add food_category table to allow queries on specific categories
Want to look into adding the django rest api framework: https://www.django-rest-framework.org/
sudo docker run --name postgresdev -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=enterpassword -e POSTGRES_DB=prod -p 60000:5432 -d postgres:latest
sudo cat backup.sql | sudo docker exec -i postgresdev psql -U postgres
sudo docker exec -it postgresdev bash