fix: Dockerfile
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 5s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 5s
This commit is contained in:
parent
a10626e756
commit
5d3997343f
1 changed files with 20 additions and 16 deletions
36
Dockerfile
36
Dockerfile
|
|
@ -3,32 +3,36 @@ FROM node:23-slim AS base
|
||||||
ENV PNPM_HOME="/pnpm"
|
ENV PNPM_HOME="/pnpm"
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
|
|
||||||
RUN corepack enable
|
RUN corepack enable \
|
||||||
RUN apt-get update && apt-get install -y openssl fontconfig
|
&& corepack prepare pnpm@9.15.0 --activate
|
||||||
RUN fc-cache -f -v
|
|
||||||
RUN pnpm i -g prisma prisma-kysely
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y openssl fontconfig \
|
||||||
|
&& fc-cache -f -v \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
FROM base AS deps
|
|
||||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
|
|
||||||
RUN pnpm prisma generate
|
|
||||||
|
|
||||||
FROM base AS build
|
FROM base AS build
|
||||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||||
RUN pnpm prisma generate
|
pnpm install --frozen-lockfile
|
||||||
|
RUN pnpm exec prisma generate
|
||||||
RUN pnpm run build
|
RUN pnpm run build
|
||||||
|
|
||||||
FROM base AS prod
|
FROM base AS deps
|
||||||
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||||
|
pnpm install --prod --frozen-lockfile
|
||||||
|
|
||||||
ENV NODE_ENV="production"
|
FROM node:23-slim AS prod
|
||||||
|
ENV NODE_ENV=production
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
COPY --from=deps /app/node_modules /app/node_modules
|
COPY --from=deps /app/node_modules /app/node_modules
|
||||||
COPY --from=build /app/dist /app/dist
|
COPY --from=build /app/dist /app/dist
|
||||||
COPY --from=base /app/static /app/static
|
COPY --from=build /app/prisma /app/prisma
|
||||||
|
COPY --from=build /app/static /app/static
|
||||||
RUN chmod u+x ./entrypoint.sh
|
COPY entrypoint.sh .
|
||||||
|
|
||||||
|
RUN chmod +x ./entrypoint.sh
|
||||||
ENTRYPOINT ["./entrypoint.sh"]
|
ENTRYPOINT ["./entrypoint.sh"]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue