understanding commited on
Commit
8cf13b3
·
verified ·
1 Parent(s): 14960b8

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:20-alpine
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies & optimize npm
6
+ RUN apk add --no-cache git && \
7
+ npm install -g [email protected]
8
+
9
+ # Copy package files and install dependencies
10
+ COPY package*.json ./
11
+ RUN npm install --omit=dev && \
12
+ npm cache clean --force
13
+
14
+ # Copy application files
15
+ COPY . .
16
+
17
+ # Create required directories with proper permissions
18
+ RUN mkdir -p \
19
+ /.auth \
20
+ ./session \
21
+ ./downloads \
22
+ ./auth_info_baileys && \
23
+ chown -R node:node \
24
+ /.auth \
25
+ ./session \
26
+ ./downloads \
27
+ ./auth_info_baileys
28
+
29
+ # Switch to non-root user for security
30
+ USER node
31
+
32
+ CMD ["node", "src/index.js"]