-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
26 lines (18 loc) · 880 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Use the Node.js image with a specific version (node:20.9.0-alpine3.17) as the base image.
FROM node:20.9.0-alpine3.17
# Set the working directory inside the container to /app.
WORKDIR /app
# Set the working directory inside the container to /app.
COPY package*.json ./
# Set the working directory inside the container to /app.
RUN npm install
# Copy the rest of the application source code from the host machine to the container's /app directory.
COPY . .
# Run 'npm run build' to execute any build scripts for the Node.js application (e.g., transpile TypeScript to JavaScript).
RUN npm run build
# Run Prisma generate during the build process
RUN npx prisma generate
# Expose port 5000 to the outside world, allowing external access to the application.
EXPOSE 5000
# Start the Node.js application using 'npm start' when the container is launched.
CMD ["npm", "start"]