File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change 1+ #  latest supported node version when this Dockerfile was written
2+ ARG  NODE_VERSION=22.12.0-alpine
3+ ARG  APP_DIR=/usr/src/parse
4+ 
15#  Builder stage
2- FROM  node:22.12.0-alpine  AS builder
6+ FROM  node:${NODE_VERSION}  AS builder
37
4- WORKDIR  /usr/src/parse 
8+ WORKDIR  ${APP_DIR} 
59
610COPY  package*.json .
711
@@ -11,20 +15,17 @@ COPY . .
1115
1216RUN  npm run build
1317
14- #  latest supported node version when this Dockerfile was written
15- FROM  node:22.12.0-alpine
18+ FROM  node:${NODE_VERSION}
1619
17- WORKDIR  /usr/src/parse 
20+ WORKDIR  ${APP_DIR} 
1821
1922#  Copy only the required files from the builder stage
20- COPY  --from=builder /usr/src/parse /node_modules ./node_modules
21- COPY  --from=builder /usr/src/parse/ dist ./dist 
22- COPY  --from=builder /usr/src/parse /public ./public
23+ COPY  --from=builder ${APP_DIR} /node_modules ./node_modules
24+ COPY  --from=builder ${APP_DIR}/ dist ./
25+ COPY  --from=builder ${APP_DIR} /public ./public
2326
24- ENV  APP_ID=setYourAppId
25- ENV  MASTER_KEY=setYourMasterKey
26- ENV  DATABASE_URI=setMongoDBURI
27+ VOLUME  ["${APP_DIR}/cloud" , "${APP_DIR}/logs" ]
2728
2829EXPOSE  1337
2930
30- CMD  ["node" , "dist/ index.js" ]
31+ CMD  ["node" , "index.js" ]
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments