Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create local postGres #8

Open
tds455 opened this issue Feb 16, 2024 · 6 comments
Open

Create local postGres #8

tds455 opened this issue Feb 16, 2024 · 6 comments
Assignees

Comments

@tds455
Copy link
Collaborator

tds455 commented Feb 16, 2024

No description provided.

@tds455 tds455 self-assigned this Feb 16, 2024
@tds455
Copy link
Collaborator Author

tds455 commented Mar 1, 2024

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

@tds455
Copy link
Collaborator Author

tds455 commented Mar 1, 2024

61522e1

added backup.sql

@tds455
Copy link
Collaborator Author

tds455 commented Mar 4, 2024

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

@Evomatic
Copy link
Contributor

Evomatic commented Mar 5, 2024

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.

@tds455
Copy link
Collaborator Author

tds455 commented Mar 5, 2024

Updated to do: add food_category table to allow queries on specific categories

@Evomatic
Copy link
Contributor

Evomatic commented Mar 5, 2024

Want to look into adding the django rest api framework: https://www.django-rest-framework.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants