-
Notifications
You must be signed in to change notification settings - Fork 1
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
[LLSC-32] Add script for starting up a postgres database with docker #10
base: main
Are you sure you want to change the base?
Conversation
backend/README.md
Outdated
@@ -34,13 +34,19 @@ To start the backend locally, use the following command: | |||
pdm run dev | |||
``` | |||
|
|||
Note: If you wish to run the backend outside of Docker (e.g., for local development), you'll need to set up a PostgreSQL database. Ensure your database configuration is set properly in the environment variables before running the project. For the time being, the recommended approach for local development using the database is to use the docker compose Postgres instance with your local dev backend. | |||
Note: If you wish to run the backend outside of Docker (e.g., for local development), you'll need to set up a PostgreSQL database. Ensure your database configuration is set properly in the environment variables before running the project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add some note about setting up the readme properly prior to running this command
CMD pg_isready -U ${POSTGRES_USER} || exit 1 | ||
|
||
# Expose PostgreSQL port | ||
EXPOSE 5432 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question when we run pdm run dev
are we currently connecting to the right db port so that we automatically connect to the db when running locally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep 5432 is the current default db port.
Notion ticket link
Add postgres docker
Implementation description
Currently docker-compose is not convenient to iterate on, so it doesn't make sense to rely on it for a database. Instead, I've created a separate Dockerfile for testing the database during development.
Steps to test
pdm run db
docker ps | grep llsc_db_dev_local
to see if it's been started up.Checklist