Skip to content

Commit

Permalink
refactor: Make the Dockerfile a tiny bit cache friendlier
Browse files Browse the repository at this point in the history
Still not great as the whole installation happens after copying
but at least not copying is not the first thing we do.

Related #124
  • Loading branch information
maringuu committed Aug 15, 2024
1 parent b765474 commit fd54825
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
FROM phusion/baseimage:jammy-1.0.3

WORKDIR /opt/app

COPY . /opt/app

WORKDIR /opt/app/fact_extractor

# Install python and create a virtualenv
ARG USER=root
ARG DEBIAN_FRONTEND=noninteractive

RUN install_clean python3.11 python3.11-dev python3.11-venv gcc
RUN python3.11 -m venv /venv
ENV PATH=/venv/bin:$PATH

RUN python3.11 -m venv venv

RUN . venv/bin/activate && install/pre_install.sh

RUN . venv/bin/activate && venv/bin/python3.11 install.py
# Copy and install fact_extractor
COPY . /opt/app
WORKDIR /opt/app/fact_extractor
RUN . /venv/bin/activate && install/pre_install.sh
RUN . /venv/bin/activate && /venv/bin/python3.11 install.py

ENV PATH=/opt/app/fact_extractor/venv/bin:$PATH

ENTRYPOINT ["./docker_extraction.py"]

0 comments on commit fd54825

Please sign in to comment.