Skip to content

Commit

Permalink
Update docs to run local database (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnwz123 authored Feb 4, 2025
1 parent 375c135 commit 48e2a1f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
33 changes: 29 additions & 4 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
## Setup
## Using Docker

Ensure you have Docker installed on your local machine.

Navigate to the root of the project directory where the `docker-compose.yml` file is located.

Build and run the Docker containers:

```
docker-compose up --build
```

The backend should be running and accessible at `http://localhost:8000`

## Using External PostgreSQL Database

Update the `.env.backend.dev` file with the database credentials.

```
SQL_DATABASE=your_db_name
SQL_USER=your_db_user
SQL_PASSWORD=your_password
SQL_HOST=your_db_host
```

### Setup

Ensure you have [python 3.9](https://www.python.org/downloads/) installed on your local machine.

Expand Down Expand Up @@ -31,14 +56,14 @@ Finally, execute:

To install all app dependencies.

## Run Development Server
### Run Development Server

**`python treeckle/manage.py runserver`**

## Create migration
### Create migration

**`python treeckle/manage.py makemigrations`**

## Run migration
### Run migration

**`python treeckle/manage.py migrate`**
3 changes: 3 additions & 0 deletions backend/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/sh

# Keep the line endings for this file as LF.
# https://stackoverflow.com/questions/44460825/entrypoint-file-not-found

if [ "$DATABASE" = "postgres" ]
then
echo "Waiting for postgres..."
Expand Down

0 comments on commit 48e2a1f

Please sign in to comment.