Commit 8e0ba439 authored by Muhammad Umair Khan's avatar Muhammad Umair Khan
Browse files

optimize ACME Docker build cache for Python dependencies

parent 5cb0792d
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -47,9 +47,13 @@ RUN git clone --branch development https://github.com/ankraft/ACME-oneM2M-CSE.gi

WORKDIR /usr/src/app/ACME-oneM2M-CSE

# Install Python dependencies before copying frequently-changing files
# so this layer can be reused from cache.
RUN pip3 install -r requirements.txt --break-system-packages

# Copy local customizations
COPY ./data /usr/src/app/ACME-oneM2M-CSE

RUN chmod +x entrypoint.sh \
  && pip3 install --no-cache-dir -r requirements.txt --break-system-packages
RUN chmod +x entrypoint.sh

ENTRYPOINT ["./entrypoint.sh"]
 No newline at end of file
+6 −4
Original line number Diff line number Diff line
@@ -54,10 +54,12 @@ RUN git clone --branch development https://github.com/ankraft/ACME-oneM2M-CSE.gi

WORKDIR /usr/src/app/ACME-oneM2M-CSE

# Install dependencies before copying your custom files
RUN pip3 install -r requirements.txt --break-system-packages

# Copy files that change frequently afterwards
COPY ./data /usr/src/app/ACME-oneM2M-CSE

RUN chmod +x entrypoint.sh \
  && pip3 install --no-cache-dir -r requirements.txt --break-system-packages
RUN chmod +x entrypoint.sh

ENTRYPOINT ["./entrypoint.sh"]
 No newline at end of file