Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
FROM node:20.11.1-alpine AS base
FROM node:22.23.5-alpine AS base
ENV SKIP_ENV_VALIDATION="true"
ENV DOCKER_OUTPUT=1
ENV NEXT_TELEMETRY_DISABLED 1

RUN apk add --no-cache libc6-compat
RUN apk add --no-cache libc6-compat openssl
RUN apk update

WORKDIR /app
RUN npm i -g pnpm@8.9
RUN npm i -g pnpm@8.9.2
RUN ls
COPY package.json pnpm-lock.yaml ./
# postinstall runs `prisma generate`, which needs the schema
COPY prisma ./prisma

RUN pnpm install
RUN pnpm install --frozen-lockfile

COPY . .
RUN pnpm generate
RUN pnpm build

FROM node:20-alpine3.19 as release
FROM node:22.23.5-alpine AS release
WORKDIR /app
RUN npm i -g pnpm@8.9
RUN npm i -g pnpm@8.9.2

RUN apk add --no-cache libc6-compat
RUN apk add --no-cache libc6-compat openssl
RUN apk update


Expand All @@ -35,12 +37,11 @@ COPY --from=base /app/public ./public

COPY --from=base /app/prisma/schema.prisma ./prisma/schema.prisma
COPY --from=base /app/prisma/migrations ./prisma/migrations
COPY --from=base /app/node_modules/prisma ./node_modules/prisma
COPY --from=base /app/node_modules/@prisma ./node_modules/@prisma

# Symlink the prisma binary
RUN mkdir node_modules/.bin
RUN ln -s /app/node_modules/prisma/build/index.js ./node_modules/.bin/prisma
# Migrations run with the Prisma CLI from the lockfile. The copied pnpm package can't run on its
# own (its dependencies live elsewhere in the store), and `pnpx prisma` would fetch the latest.
RUN npm i -g prisma@5.22.0

# set this so it throws error where starting server
ENV SKIP_ENV_VALIDATION="false"
Expand Down
4 changes: 2 additions & 2 deletions docker/start.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

set -x
set -ex

echo "Deploying prisma migrations"

pnpx prisma migrate deploy --schema ./prisma/schema.prisma
prisma migrate deploy --schema ./prisma/schema.prisma

echo "Starting web server"

Expand Down
Loading