Skip to content

Commit

Permalink
Merge pull request #610 from kids-first/fix-local-dev
Browse files Browse the repository at this point in the history
🐛 Fix local dev setup and instructions
  • Loading branch information
znatty22 authored May 15, 2023
2 parents 36a0437 + fd3a375 commit 7705f2b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,20 @@ development environment
- Con: Everything is running in containers. Need to use `docker container exec` to run things in container
2. Follow the steps below to run Postgres in a docker container and the
Dataservice on your local machine
- Pro: Run everything directly on local machine
- Pro: May be more performant. Don't have to use `docker exec -it <command>`
- Con: Need to install a bunch of stuff on local machine including Python 3.7.11

```shell
# Get source from github
git clone git@github.com:kids-first/kf-api-dataservice.git
cd kf-api-dataservice

# Follow steps to install pyenv and ensure you are using Python v 3.7.11
# Follow steps to install pyenv
https://realpython.com/intro-to-pyenv/

# Setup python environment and install dependencies
virtualenv venv && source venv/bin/activate
pyenv virtualenv 3.7.11 dataservice_venv
pyenv local dataservice_venv
pip install -r dev-requirements.txt
pip install -r requirements.txt
pip install -e .
Expand All @@ -69,7 +70,7 @@ cp .env.sample .env
docker-compose up dataservice_pg

# Configure and run migrations
source .env
source env_local.sh
flask db upgrade

# Run the flask web application
Expand Down
13 changes: 13 additions & 0 deletions env_local.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# --- Postgres variables ---
export PG_HOST=localhost
export PG_PORT=5432
export PG_NAME=dataservice
export PG_USER=postgres
export PG_PASS=postgres

# --- Dataservice variables ---
export FLASK_APP=manage
export FLASK_CONFIG=development

0 comments on commit 7705f2b

Please sign in to comment.