File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed
express-postgresql-prisma Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change 1+ # Use an official Node.js runtime as a parent image
2+ FROM node:18
3+
4+ # Set the working directory
5+ WORKDIR /usr/src/app
6+
7+ # Copy the package.json and package-lock.json files
8+ COPY package*.json ./
9+
10+ # Install dependencies
11+ RUN npm install
12+
13+ # Copy the rest of the application code
14+ COPY . .
15+
16+ RUN npm run generate
17+ RUN npm run migrate init
18+
19+ RUN npm run clean-build
20+
21+ # Expose the port the app runs on
22+ EXPOSE 3000
23+
24+ # Command to start the app
25+ CMD ["npm" , "run" , "start" ]
Original file line number Diff line number Diff line change 1+ version : ' 3'
2+ services :
3+ app :
4+ build : .
5+ ports :
6+ - " 3000:3000"
7+ environment :
8+ DATABASE_URL : " postgresql://postgres:mysecretpassword@db:5432/postgres"
9+ PORT : 3000
10+ depends_on :
11+ - db
12+
13+ db :
14+ image : postgres
15+ environment :
16+ POSTGRES_USER : postgres
17+ POSTGRES_PASSWORD : mysecretpassword
18+ ports :
19+ - " 5432:5432"
20+ volumes :
21+ - postgres-data:/var/lib/postgresql/data
22+
23+ volumes :
24+ postgres-data :
You can’t perform that action at this time.
0 commit comments