-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (20 loc) · 760 Bytes
/
Dockerfile
File metadata and controls
29 lines (20 loc) · 760 Bytes
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
27
28
29
# Use the official Node.js image as the base image
FROM node:18-alpine
# Set the working directory inside the container
WORKDIR /app
# Copy package.json and package-lock.json (note: not pnpm-lock.yaml)
COPY package.json package-lock.json ./
# Install dependencies using npm
RUN npm install
# Install TypeScript locally to ensure tsc is available
RUN npm install -D typescript
# Copy the rest of the application code
COPY . .
# Ensure all type definitions are installed
RUN npm install -D @types/node @types/body-parser @types/jsonwebtoken @types/bcryptjs @types/express @prisma/client
# Build the TypeScript code
RUN npm run build
# Expose the port the app runs on
EXPOSE 3000
# Define the command to run the application
CMD ["node", "dist/index.js"]