-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (28 loc) · 943 Bytes
/
Dockerfile
File metadata and controls
38 lines (28 loc) · 943 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
30
31
32
33
34
35
36
37
38
##################
# BASE IMAGE
##################
FROM node:20-alpine AS base
##############################
# DEVELOPMENT STAGE
##############################
FROM base AS development
WORKDIR /app
# Copy only the package files first to leverage Docker cache
COPY package*.json ./
# Install dependencies (including devDependencies)
RUN npm ci --only=development
# Copy prisma folder into the container
COPY prisma ./prisma
# Generate Prisma client
RUN npx prisma generate
# Copy the rest of the app source code
COPY . .
# Ensure the node user has the correct permissions
RUN chown -R node:node /app
# Switch to node user for better security
USER node
# Expose the port for the development server
EXPOSE 8080
# Start the server with an increased memory limit
CMD ["node", "dist/main.js"]
# © Copyright belongs to the account [ahkiet lekiett2201@gmail.com]. Unauthorized copying, selling, distribution, or modification is prohibited.