deploy: copy prisma config and ditch dotenv from the config itself
Pedro Lucas Porcellis porcellis@eletrotupi.com · 4 months ago
d514519d4f8fe5f8547a2f8b0c67f21e790b7480 Browse filesParents
aa62de4Changed files
2
Additions
+1
Deletions
-1
api/Dockerfile.production
1 1
# Build stage
2 2
FROM node:24-alpine3.23 AS builder
3 3
4 4
RUN apk add --no-cache build-base yaml-dev
5 5
12 12
# Install all deps (including dev, which is needed for tsc, tsc-alias, prisma)
13 13
COPY --chown=${UID}:${GID} package*.json ./
14 14
RUN npm ci --frozen-lockfile
15 15
16 16
COPY --chown=${UID}:${GID} prisma ./prisma/
17 +
COPY --chown=${UID}:${GID} ./prisma.config.ts ./
17 18
RUN npx prisma generate
18 19
19 20
COPY --chown=${UID}:${GID} . .
20 21
21 22
# Compile TS and spit on dist/
45 46
46 47
EXPOSE 3000
47 48
48 49
# migrate then start
49 50
CMD ["sh", "-c", "npx prisma migrate deploy && npm run prod"]
api/prisma.config.ts
1 -
import "dotenv/config";
2 1
import { defineConfig } from "prisma/config";
3 2
4 3
export default defineConfig({
5 4
schema: "prisma/schema.prisma",
6 5
migrations: {
8 7
},
9 8
datasource: {
10 9
url: process.env["DATABASE_URL"],
11 10
},
12 11
});