-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Replaced zod with valibot - Updated all deps - Removed a bunch of pnpm scripts in favor of doing things programatically - Improved Dockerfile to reuse stages better and add a node compile cache
- Loading branch information
Showing
30 changed files
with
1,656 additions
and
2,518 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,55 @@ | ||
FROM node:22-alpine AS runtime_deps | ||
|
||
RUN corepack enable | ||
FROM node:22-alpine as base | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json . | ||
COPY pnpm-lock.yaml . | ||
COPY .npmrc . | ||
|
||
ENV PNPM_HOME=/pnpm | ||
ENV CI=1 | ||
# Use production in case any dependencies use it in any way | ||
ENV NODE_ENV=production | ||
# Install dependencies | ||
RUN pnpm install --frozen-lockfile | ||
|
||
FROM node:22-alpine AS docs | ||
# Enable node compile cache | ||
ENV NODE_COMPILE_CACHE=/node-cc | ||
RUN mkdir -p $NODE_COMPILE_CACHE | ||
|
||
FROM base as base_deps | ||
|
||
ENV CI=1 | ||
|
||
COPY .npmrc package.json pnpm-lock.yaml ./ | ||
|
||
RUN corepack enable | ||
RUN corepack prepare --activate | ||
|
||
WORKDIR /app | ||
FROM base_deps as runtime_deps | ||
|
||
# Install dependencies | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \ | ||
pnpm install --frozen-lockfile --production | ||
|
||
FROM base_deps AS docs | ||
|
||
COPY package.json . | ||
COPY pnpm-lock.yaml . | ||
COPY .npmrc . | ||
COPY docs/openapi.yaml docs/openapi.yaml | ||
|
||
ENV CI=1 | ||
# Install dependencies | ||
RUN pnpm install --frozen-lockfile | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \ | ||
pnpm install --frozen-lockfile | ||
|
||
RUN pnpm run docs | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \ | ||
pnpm run docs | ||
|
||
FROM node:22-alpine | ||
FROM base | ||
|
||
RUN corepack enable | ||
COPY .npmrc knexfile.js package.json pnpm-lock.yaml ./ | ||
COPY src/ src/ | ||
COPY migrations/ migrations/ | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
COPY --from=runtime_deps /app/node_modules node_modules | ||
COPY --from=runtime_deps /app/node_modules/ node_modules/ | ||
COPY --from=docs /app/redoc-static.html . | ||
|
||
# Run with... | ||
# Source maps enabled, since it does not affect performance from what I found | ||
ENV NODE_OPTIONS="--enable-source-maps" | ||
# Warnings disabled, we know what we're doing and they're annoying | ||
ENV NODE_NO_WARNINGS=1 | ||
# Use production in case any dependencies use it in any way | ||
ENV NODE_ENV=production | ||
|
||
CMD ["pnpm", "--silent", "start"] | ||
CMD ["node", "--run", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.