Skip to content

Commit

Permalink
docker fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gc committed Nov 23, 2024
1 parent 763f3a1 commit 28b6d73
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,31 @@ ENTRYPOINT ["dumb-init", "--"]
FROM base AS dependencies
WORKDIR /usr/src/app

COPY package.json pnpm-lock.yaml ./
COPY src/config.example.ts src/config.ts
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./

RUN pnpm install --frozen-lockfile

FROM base AS build-run
FROM base AS build
WORKDIR /usr/src/app

COPY --from=dependencies /usr/src/app/node_modules /usr/src/app/node_modules
COPY --from=dependencies /usr/src/app/pnpm-lock.yaml /usr/src/app/pnpm-lock.yaml

COPY . .
COPY src/config.example.ts src/config.ts

RUN pnpm install --frozen-lockfile --offline
RUN pnpm run monorepo:build

FROM base AS build-run
WORKDIR /usr/src/app

COPY --from=build /usr/src/app /usr/src/app

ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.9.0/wait /wait
RUN chmod +x /wait
CMD (/wait > /dev/null 2>&1) && \
(pnpm prisma db push --schema='./prisma/robochimp.prisma' > /dev/null 2>&1 & \
pnpm prisma db push --schema='./prisma/schema.prisma' > /dev/null 2>&1 & \
wait) && \
pnpm run monorepo:build && \
NODE_NO_WARNINGS=1 pnpmvitest run --config vitest.integration.config.mts && \
NODE_NO_WARNINGS=1 pnpm vitest run --config vitest.integration.config.mts && \
exit 0

0 comments on commit 28b6d73

Please sign in to comment.