-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build: add tsup config * build: fixup dockerfile - Update node to version 20.12 and capitalize the AS keyword - split up common pnpm args into an env - Install prod node env now tsup doesn't bundle node deps * build: remove esbuild config
- Loading branch information
Showing
5 changed files
with
511 additions
and
143 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,15 +1,16 @@ | ||
################ | ||
# Build assets # | ||
################ | ||
FROM node:20.10 as build | ||
FROM node:20.12 AS build | ||
WORKDIR /app | ||
|
||
# Install global node modules: pnpm | ||
RUN npm install -g [email protected] | ||
ENV PNPM_ARGS="--frozen-lockfile --ignore-scripts" | ||
|
||
# Install Node modules | ||
COPY package.json pnpm-lock.yaml ./ | ||
RUN pnpm install --frozen-lockfile --ignore-scripts | ||
RUN pnpm install ${PNPM_ARGS} | ||
|
||
# Generate Prisma schemas | ||
COPY prisma ./prisma | ||
|
@@ -19,11 +20,12 @@ COPY . . | |
|
||
ENV NODE_ENV=production | ||
RUN pnpm build | ||
RUN pnpm install --production ${PNPM_ARGS} | ||
|
||
#################### | ||
# Production image # | ||
#################### | ||
FROM node:20.10-slim as production | ||
FROM node:20.12-slim AS production | ||
WORKDIR /app | ||
|
||
RUN set -xe && \ | ||
|
@@ -34,6 +36,7 @@ RUN set -xe && \ | |
rm -rf /var/lib/apt/lists/* /usr/share/man/* /usr/share/doc/* | ||
|
||
COPY --chown=node:node --from=build /app/build build | ||
COPY --chown=node:node --from=build /app/node_modules node_modules | ||
|
||
USER node | ||
ENV NODE_ENV=production | ||
|
This file was deleted.
Oops, something went wrong.
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.