Skip to content

Commit dd5e1ce

Browse files
committed
test
1 parent f13fd22 commit dd5e1ce

2 files changed

Lines changed: 17 additions & 25 deletions

File tree

Dockerfile

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,36 @@
1-
# ---- deps ----
1+
# Dockerfile
22
FROM node:20-alpine AS deps
33
WORKDIR /app
4-
RUN apk add --no-cache openssl # für pnpm hooks/engines, schadet nicht
54
RUN npm install -g pnpm
65
COPY package.json pnpm-lock.yaml ./
76
COPY prisma ./prisma
8-
# vollständige Installation (dev + prod), damit wir bauen/generate können
9-
RUN pnpm install --frozen-lockfile
7+
RUN pnpm install
8+
109

11-
# ---- builder ----
1210
FROM node:20-alpine AS builder
1311
WORKDIR /app
1412
RUN npm install -g pnpm
1513
COPY . .
1614
COPY --from=deps /app/node_modules ./node_modules
17-
# Prisma-Client für Alpine generieren (zieht die linux-musl Engines)
18-
RUN pnpm prisma generate
19-
# Next bauen
20-
RUN pnpm build
21-
# Für schlankes Prod-Image: nur prod-deps behalten
22-
RUN pnpm prune --prod
15+
ARG SECRET
16+
ARG DATABASE_URL
17+
ARG NEXT_PUBLIC_URL
18+
ARG NEXT_PUBLIC_PRICE_POOL
19+
ENV SECRET=$SECRET
20+
ENV DATABASE_URL=$DATABASE_URL
21+
ENV NEXT_PUBLIC_URL=$NEXT_PUBLIC_URL
22+
ENV NEXT_PUBLIC_PRICE_POOL=$NEXT_PUBLIC_PRICE_POOL
23+
RUN pnpm run build
2324

24-
# ---- prod ----
2525
FROM node:20-alpine AS prod
2626
WORKDIR /app
27-
# Laufzeit-Abhängigkeiten
28-
RUN apk add --no-cache openssl libc6-compat
29-
# App-Dateien
3027
COPY --from=builder /app/public ./public
31-
COPY --from=builder /app/.next ./.next
3228
COPY --from=builder /app/prisma ./prisma
29+
COPY --from=builder /app/.next ./.next
30+
COPY --from=builder /app/node_modules ./node_modules
3331
COPY --from=builder /app/package.json ./package.json
3432
COPY --from=builder /app/pnpm-lock.yaml ./pnpm-lock.yaml
35-
# Nur Produktions-Node-Modules übernehmen (schlank)
36-
COPY --from=builder /app/node_modules ./node_modules
3733
RUN npm install -g pnpm
38-
# Start: dein package.json "start" macht `prisma migrate deploy && next start`
39-
EXPOSE 3000
4034
CMD ["pnpm", "run", "start"]
35+
36+

prisma/schema.prisma

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
// Prisma schema
22

33
generator client {
4-
provider = "prisma-client-js"
5-
binaryTargets = ["linux-musl", "native"] // Alpine == musl
4+
provider = "prisma-client-js"
65
}
76

8-
9-
10-
117
datasource db {
128
provider = "postgresql"
139
url = env("DATABASE_URL")

0 commit comments

Comments
 (0)