-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor: use heroku.yml and run migrations in release phase #50
Changes from all commits
2ab3df8
c47add3
1b35877
f04d4b3
7ee7a79
ea4b12e
5fab0db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is to work around the weird heroku "run", There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As mentioned above, maybe worth making note of this within the file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
RUN pip3 install -r requirements.txt | ||
RUN yarnpkg install |
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PGSSLMODE was needed because without it the underlying node postgres library throws an error. |
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.
note: this is an adjustment that i needed to make because previously i was using the
python3-poetry
from debian package manager, and that version of poetry did not support the export command in line 16 belowThere 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.
Maybe worth adding a note to the
Install indexer
comment about the version and use ofexport
.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.
5fab0db