Skip to content

Commit

Permalink
feat: add BLAST to backend container
Browse files Browse the repository at this point in the history
  • Loading branch information
alubbock committed Oct 10, 2024
1 parent c4a95c6 commit c2c4872
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM python:3.11-bullseye AS builder
FROM quay.io/rosalindfranklininstitute/blast:2.16.0 AS blast

FROM python:3.12-bookworm AS builder

RUN pip install --user wheel pipenv

Expand All @@ -16,15 +18,21 @@ COPY antigenapi /usr/src/antigenapi

RUN DJANGO_CI=true .venv/bin/python manage.py collectstatic --noinput

FROM python:3.11-slim-bullseye AS prod
FROM python:3.12-slim-bookworm AS prod

# liblmdb-dev required by BLAST
RUN apt-get update && apt-get install -y \
libxml2 \
media-types \
liblmdb-dev \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -v /usr/src/.venv

# blastp and makeblastdb commands
COPY --from=blast /blast/ReleaseMT/bin/blastp /usr/local/bin/blastp
COPY --from=blast /blast/ReleaseMT/bin/makeblastdb /usr/local/bin/makeblastdb

COPY --from=builder /usr/src/.venv/ /usr/src/.venv/
COPY --from=builder /usr/src/static/ /api_data/static/
COPY --from=builder /usr/src/manage.py /usr/src/
Expand All @@ -42,6 +50,13 @@ CMD [".venv/bin/uwsgi", "--ini", "uwsgi.ini"]

FROM builder AS dev

# liblmdb-dev required by BLAST
RUN apt update && apt install -y liblmdb-dev && rm -rf /var/lib/apt/lists/*

# blastp and makeblastdb commands
COPY --from=blast /blast/ReleaseMT/bin/blastp /usr/local/bin/blastp
COPY --from=blast /blast/ReleaseMT/bin/makeblastdb /usr/local/bin/makeblastdb

ENV PATH="$PATH:/root/.local/bin:/usr/src/.venv/bin"

RUN pipenv sync --dev
Expand Down

0 comments on commit c2c4872

Please sign in to comment.