Skip to content

Commit

Permalink
change heroku db handling
Browse files Browse the repository at this point in the history
  • Loading branch information
solaluset committed Jan 9, 2023
1 parent 1fc51e1 commit 546553b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ WORKDIR /app

COPY . .

ARG HEROKU
ENV HEROKU=$HEROKU
ARG HEROKU_DB
ENV HEROKU_DB=$HEROKU_DB
ENV BOT_TOKEN=
ENV SPOTIFY_ID=
ENV SPOTIFY_SECRET=
Expand Down
7 changes: 1 addition & 6 deletions config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@
# Must be async-compatible
# CHANGE ONLY IF YOU KNOW WHAT YOU'RE DOING
DATABASE = alchemize_url(
get_env_var(
"DATABASE_URL",
"sqlite:///settings.db" if not os.getenv("HEROKU")
# assume postgres as default db on Heroku
else "postgres",
)
get_env_var("DATABASE_URL", os.getenv("HEROKU_DB") or "sqlite:///settings.db")
)


Expand Down
3 changes: 2 additions & 1 deletion heroku.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ build:
docker:
worker: Dockerfile
config:
HEROKU: 1
# your database type
HEROKU_DB: postgres

0 comments on commit 546553b

Please sign in to comment.