Skip to content

Commit

Permalink
Merge pull request #3 from mlibrary/DWI-24-continuous-deployment
Browse files Browse the repository at this point in the history
DWI-24 continued: Fixes production Docker image
  • Loading branch information
niquerio authored Sep 24, 2024
2 parents bb6b7a7 + e257214 commit c0d3ce6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \
python3-dev \
default-libmysqlclient-dev \
build-essential \
pkg-config
pkg-config \
default-mysql-client \
vim-tiny

# Set the working directory to /app
WORKDIR /app
Expand Down Expand Up @@ -87,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
10 changes: 6 additions & 4 deletions aim/digifeeds/bin/load_statuses.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import sys
from aim.digifeeds.database.models import load_statuses
from aim.digifeeds.database.main import SessionLocal
import sys


def main():
with SessionLocal() as db_session:
load_statuses(session=db_session)
load_statuses(session=db_session)


if __name__=='__main__':
sys.exit(main())
if __name__ == "__main__":
sys.exit(main())
3 changes: 1 addition & 2 deletions aim/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os

S = SimpleNamespace()
S.mysql_database = f'mysql+mysqldb://{os.environ["MARIADB_USER"]}:{os.environ["MARIADB_PASSWORD"]}@{os.environ["DATABASE_HOST"]}/{os.environ["DATABASE_HOST"]}'
S.mysql_database = f'mysql+mysqldb://{os.environ["MARIADB_USER"]}:{os.environ["MARIADB_PASSWORD"]}@{os.environ["DATABASE_HOST"]}/{os.environ["MARIADB_DATABASE"]}'
S.test_database = "sqlite:///:memory:"
S.ci_on = os.getenv("CI")

0 comments on commit c0d3ce6

Please sign in to comment.