Service-Xi commited on
Commit
01f8125
·
verified ·
1 Parent(s): 617aed0

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -0
Dockerfile ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:18-alpine
2
+
3
+ # Install git
4
+ RUN apk add --no-cache git
5
+
6
+ # Clone repo
7
+ RUN git clone https://github.com/Kingdavid102/fedex2.git /app
8
+
9
+ # Set working directory
10
+ WORKDIR /app
11
+
12
+ # Install dependencies
13
+ RUN npm install
14
+
15
+ # Create uploads & products.json inside /app with correct permissions
16
+ RUN mkdir -p /app/uploads && \
17
+ touch /app/products.json && \
18
+ chown -R node:node /app && \
19
+ chmod -R 755 /app/uploads && \
20
+ chmod 644 /app/products.json
21
+
22
+ # Switch to non-root user
23
+ USER node
24
+
25
+ # Environment variables
26
+ ENV PORT=7860
27
+ ENV NODE_ENV=production
28
+
29
+ EXPOSE 7860
30
+
31
+ CMD ["node", "server.js"]