File tree Expand file tree Collapse file tree 5 files changed +61
-4
lines changed Expand file tree Collapse file tree 5 files changed +61
-4
lines changed Original file line number Diff line number Diff line change 1+ Dockerfile
2+ node_modules
3+ generated
Original file line number Diff line number Diff line change 1+ FROM node:lts-alpine AS builder
2+ WORKDIR /app
3+ COPY package*.json ./
4+ RUN npm ci
5+ COPY . .
6+ RUN npm run prisma:generate
7+ RUN npm run build
8+
9+ FROM node:lts-alpine AS production
10+ WORKDIR /app
11+ RUN chown -R node:node /app
12+
13+ COPY --chown=node:node package*.json ./
14+ RUN npm ci --omit=dev
15+
16+ COPY --from=builder --chown=node:node /app/build ./build
17+ COPY --from=builder --chown=node:node /app/generated ./generated
18+ COPY --from=builder --chown=node:node /app/prisma ./prisma
19+
20+ USER node
21+
22+ EXPOSE 3000
23+
24+ CMD [ "sh" , "-c" , "npm run prisma:migrate:deploy && npm run start" ]
Original file line number Diff line number Diff line change 1+ services :
2+ web :
3+ build :
4+ context : .
5+ dockerfile : Dockerfile
6+ ports :
7+ - " 80:3000"
8+ environment :
9+ DATABASE_URL : postgresql://postgres:letmein@db:5432/postgres?schema=public
10+ depends_on :
11+ db :
12+ condition : service_healthy
13+
14+ db :
15+ image : postgres:alpine
16+ environment :
17+ POSTGRES_USER : postgres
18+ POSTGRES_PASSWORD : letmein
19+ POSTGRES_DB : postgres
20+ ports :
21+ - " 5432:5432"
22+ volumes :
23+ - fs_data:/var/lib/postgresql/data
24+ healthcheck :
25+ test : ["CMD-SHELL", "pg_isready -U postgres"]
26+ interval : 5s
27+ timeout : 5s
28+ retries : 5
29+
30+ volumes :
31+ fs_data:
Original file line number Diff line number Diff line change 44 "version" : " 0.0.0" ,
55 "type" : " module" ,
66 "scripts" : {
7- "dev" : " react-router dev" ,
7+ "dev" : " react-router dev --host " ,
88 "build" : " react-router build" ,
99 "lint" : " eslint ." ,
1010 "preview" : " vite preview" ,
5151 "react-router" : " ^7.5.1" ,
5252 "tailwind-merge" : " ^2.5.5" ,
5353 "tailwindcss-animate" : " ^1.0.7" ,
54+ "tsx" : " ^4.19.4" ,
5455 "zod" : " ^3.24.2"
5556 },
5657 "devDependencies" : {
8182 "prisma" : " ^6.10.1" ,
8283 "react-router-devtools" : " ^1.1.10" ,
8384 "tailwindcss" : " ^3.4.17" ,
84- "tsx" : " ^4.19.4" ,
8585 "typescript" : " ~5.6.2" ,
8686 "typescript-eslint" : " ^8.15.0" ,
8787 "vite" : " ^6.0.1" ,
Original file line number Diff line number Diff line change 11import { categories , products } from "./initial_data" ;
2-
3- import { PrismaClient } from "@/../generated/prisma/client" ;
2+ import { PrismaClient } from "../generated/prisma/client" ;
43
54const prisma = new PrismaClient ( ) ;
65
You can’t perform that action at this time.
0 commit comments