Skip to content

Commit

Permalink
adds /app to PYTHONPATH in production
Browse files Browse the repository at this point in the history
  • Loading branch information
niquerio committed Sep 24, 2024
1 parent 3f88dc1 commit 7a0b5b4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ RUN mkdir -p /venv && chown ${UID}:${GID} /venv
# By adding /venv/bin to the PATH the dependencies in the virtual environment
# are used
ENV VIRTUAL_ENV=/venv \
PATH="/venv/bin:$PATH"
PATH="/venv/bin:$PATH" \
PYTHONPATH="/app"

COPY --chown=${UID}:${GID} . /app
COPY --chown=${UID}:${GID} --from=build "/app/.venv" ${VIRTUAL_ENV}
Expand Down
6 changes: 2 additions & 4 deletions aim/digifeeds/bin/load_statuses.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import sys

sys.path = ["", "../../"] + sys.path[1:]
from aim.digifeeds.database.models import load_statuses # noqa: E402
from aim.digifeeds.database.main import SessionLocal # noqa: E402
from aim.digifeeds.database.models import load_statuses
from aim.digifeeds.database.main import SessionLocal


def main():
Expand Down
6 changes: 2 additions & 4 deletions aim/digifeeds/database/migrations/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
from sqlalchemy import pool

from alembic import context
import sys

sys.path = ["", "../../../"] + sys.path[1:]
from aim.digifeeds.database.models import Base # noqa: E402
from aim.services import S # noqa: E402
from aim.digifeeds.database.models import Base
from aim.services import S

# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
Expand Down

0 comments on commit 7a0b5b4

Please sign in to comment.