Skip to content

Commit

Permalink
Build caching
Browse files Browse the repository at this point in the history
  • Loading branch information
ipmb committed Feb 10, 2024
1 parent 381acea commit c2233d6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,27 @@ FROM node:20-alpine as build-node

WORKDIR /home/node/app/client
COPY client/package-lock.json client/package.json ./
RUN set -ex && npm install -g npm@latest && npm ci
RUN --mount=type=cache,target=/home/node/.npm \
set -ex && npm install -g npm@latest && npm ci
COPY client/ ./
RUN npm run build


# STAGE 2: BUILD PYTHON
FROM python:3.12-bullseye as build-python
WORKDIR /app
RUN python -m venv --prompt . --upgrade-deps /app/.venv
RUN --mount=type=cache,target=/root/.cache \
set -ex && \
python -m venv --prompt . --upgrade-deps /app/.venv && \
pip install --disable-pip-version-check --root-user-action=ignore --no-cache-dir --upgrade setuptools wheel

ENV LC_ALL=C.UTF-8 LANG=C.UTF-8 \
PATH=/app/.venv/bin:${PATH}

COPY requirements.txt ./
COPY requirements ./requirements
RUN pip install -r requirements.txt -r requirements/dev.txt
RUN --mount=type=cache,target=/root/.cache \
pip install --disable-pip-version-check --root-user-action=ignore --no-cache-dir -r requirements.txt -r requirements/dev.txt
COPY setup.cfg setup.py ./
COPY {{ project_name }}/__init__.py ./{{ project_name }}/
RUN pip install --no-deps -e .
Expand Down

0 comments on commit c2233d6

Please sign in to comment.