Skip to content

Commit

Permalink
refactor: use heroku.yml and run migrations in release phase (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
wgwz authored Oct 19, 2023
1 parent b350edd commit 19014bc
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

20 changes: 20 additions & 0 deletions heroku.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM python:3.9

# Install dependencies
RUN apt-get update
RUN apt-get install curl libpq-dev postgresql-client nodejs yarnpkg -y

# Set working directory
WORKDIR /home/indexer

# Copy source code
COPY . .

# Install indexer and pin the version of poetry
RUN pip3 install poetry==1.6.1
RUN poetry install
# the heroku.yml 'run' directive is incompatible with poetry
# so we export to the requirements.txt format and use pip3
RUN poetry export --without-hashes --format=requirements.txt > requirements.txt
RUN pip3 install -r requirements.txt
RUN yarnpkg install
9 changes: 9 additions & 0 deletions heroku.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
build:
docker:
indexer: heroku.Dockerfile
run:
indexer: python main.py
release:
image: indexer
command:
- PGSSLMODE=no-verify yarnpkg migrate

0 comments on commit 19014bc

Please sign in to comment.