Skip to content

Commit fd54825

Browse files
committed
refactor: Make the Dockerfile a tiny bit cache friendlier
Still not great as the whole installation happens after copying but at least not copying is not the first thing we do. Related #124
1 parent b765474 commit fd54825

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

Dockerfile

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
FROM phusion/baseimage:jammy-1.0.3
22

3-
WORKDIR /opt/app
4-
5-
COPY . /opt/app
6-
7-
WORKDIR /opt/app/fact_extractor
8-
3+
# Install python and create a virtualenv
94
ARG USER=root
105
ARG DEBIAN_FRONTEND=noninteractive
11-
126
RUN install_clean python3.11 python3.11-dev python3.11-venv gcc
7+
RUN python3.11 -m venv /venv
8+
ENV PATH=/venv/bin:$PATH
139

14-
RUN python3.11 -m venv venv
15-
16-
RUN . venv/bin/activate && install/pre_install.sh
17-
18-
RUN . venv/bin/activate && venv/bin/python3.11 install.py
10+
# Copy and install fact_extractor
11+
COPY . /opt/app
12+
WORKDIR /opt/app/fact_extractor
13+
RUN . /venv/bin/activate && install/pre_install.sh
14+
RUN . /venv/bin/activate && /venv/bin/python3.11 install.py
1915

20-
ENV PATH=/opt/app/fact_extractor/venv/bin:$PATH
2116

2217
ENTRYPOINT ["./docker_extraction.py"]

0 commit comments

Comments
 (0)