Skip to content

Commit

Permalink
fix: debug image build
Browse files Browse the repository at this point in the history
  • Loading branch information
bodymindarts committed Nov 1, 2023
1 parent cd0b0df commit a1998c6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ jobs:
outputs:
- name: image
params:
CONTEXT: repo/core/api
CONTEXT: repo
BUILD_ARGS_FILE: repo/.build-args
DOCKERFILE: "repo/core/api/Dockerfile-debug"
run:
Expand Down
32 changes: 19 additions & 13 deletions core/api/Dockerfile-debug
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,36 @@ RUN apk update && apk add git

RUN npm install -g pnpm

COPY ./*.json ./
RUN mkdir -p core/api/
COPY ./core/api/*.json ./core/api/
COPY pnpm-workspace.yaml package.json pnpm-lock.yaml ./

WORKDIR /app/core/api

RUN pnpm install

COPY ./src ./src
COPY ./test ./test
COPY ./core/api/src ./src
COPY ./core/api/test ./test

RUN pnpm run build

RUN touch .env
COPY ./core/api/scripts ./scripts

FROM gcr.io/distroless/nodejs20-debian11:debug
COPY --from=BUILD_IMAGE /app/.env /app/.env
COPY --from=BUILD_IMAGE /app/dist /app/dist
COPY --from=BUILD_IMAGE /app/src/config/locales /app/dist/config/locales
FROM node:20-alpine
COPY --from=BUILD_IMAGE /app/core/api/dist /app/core/api/dist
COPY --from=BUILD_IMAGE /app/core/api/src/config/locales /app/core/api/dist/config/locales
COPY --from=BUILD_IMAGE /app/node_modules /app/node_modules
COPY --from=BUILD_IMAGE /app/core/api/node_modules /app/core/api/node_modules
COPY --from=BUILD_IMAGE /app/core/api/scripts /app/core/api/scripts

WORKDIR /app
COPY ./*.js ./package.json ./tsconfig.json ./
WORKDIR /app/core/api
COPY ./core/api/*.js ./core/api/package.json ./core/api/tsconfig.json ./
RUN touch .env

### debug only
COPY --from=BUILD_IMAGE /app/src /app/src
COPY --from=BUILD_IMAGE /app/test /app/test
COPY ./junit.xml ./
COPY --from=BUILD_IMAGE /app/core/api/src /app/core/api/src
COPY --from=BUILD_IMAGE /app/core/api/test /app/core/api/test
COPY ./core/api/junit.xml ./
###

USER 1000
Expand Down

0 comments on commit a1998c6

Please sign in to comment.