File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ node_modules
2+ dist
3+ .git
4+ .gitignore
5+ .env
6+ *.md
7+ .DS_Store
8+ terraform
9+ k8s
Original file line number Diff line number Diff line change 1+ FROM node:20-alpine AS builder
2+
3+ WORKDIR /app
4+
5+ ARG PORT
6+ ARG DATABASE_URL
7+
8+ COPY package.json yarn.lock ./
9+ RUN yarn install --frozen-lockfile
10+
11+ COPY prisma ./prisma
12+ RUN yarn prisma generate
13+
14+ COPY tsconfig.json ./
15+ COPY src ./src
16+ RUN yarn tsc
17+
18+ FROM node:20-alpine AS production
19+
20+ WORKDIR /app
21+
22+ RUN addgroup -g 1001 -S nodejs && \
23+ adduser -S nodejs -u 1001
24+
25+ COPY package.json yarn.lock ./
26+ RUN yarn install --frozen-lockfile --production && yarn cache clean
27+
28+ COPY --from=builder /app/dist ./dist
29+ COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
30+ COPY prisma ./prisma
31+
32+ RUN chown -R nodejs:nodejs /app
33+
34+ USER nodejs
35+
36+ EXPOSE 3000
37+
38+ CMD ["yarn" , "run" , "start" ]
Original file line number Diff line number Diff line change 33 "version" : " 1.0.0" ,
44 "license" : " MIT" ,
55 "scripts" : {
6- "dev" : " tsx src/index.ts"
6+ "dev" : " tsx src/index.ts" ,
7+ "build" : " tsc" ,
8+ "start" : " node dist/index.js" ,
9+ "clean" : " rm -rf dist node_modules"
710 },
811 "dependencies" : {
912 "@prisma/adapter-pg" : " 7.0.0" ,
1013 "@prisma/client" : " 7.0.0" ,
1114 "express" : " 5.1.0" ,
12- "pg" : " ^8.16.3"
15+ "pg" : " ^8.16.3" ,
16+ "dotenv" : " ^17.2.1"
1317 },
1418 "devDependencies" : {
1519 "@types/express" : " 5.0.5" ,
1620 "@types/node" : " 22.18.12" ,
17- "dotenv" : " ^17.2.1" ,
1821 "prisma" : " 7.0.0" ,
1922 "tsx" : " ^4.20.6" ,
2023 "typescript" : " 5.8.2" ,
Original file line number Diff line number Diff line change 11generator client {
2- provider = " prisma-client "
3- output = " ./generated "
2+ provider = " prisma-client-js "
43}
54
65datasource db {
Original file line number Diff line number Diff line change 11import 'dotenv/config'
2- import { Prisma , PrismaClient } from '../ prisma/generated /client'
2+ import { Prisma , PrismaClient } from '@ prisma/client'
33import { PrismaPg } from '@prisma/adapter-pg'
44import express from 'express'
55
Original file line number Diff line number Diff line change 11{
22 "compilerOptions" : {
3+ "target" : " ES2020" ,
34 "sourceMap" : true ,
45 "outDir" : " dist" ,
6+ "rootDir" : " src" ,
57 "strict" : true ,
68 "lib" : [
79 " esnext"
810 ],
911 "esModuleInterop" : true ,
10- "module" : " ESNext " ,
12+ "module" : " CommonJS " ,
1113 "moduleResolution" : " node" ,
1214 "resolveJsonModule" : true
13- }
15+ },
16+ "include" : [" src/**/*" ]
1417}
You can’t perform that action at this time.
0 commit comments