abubasith86 commited on
Commit
bb7e4dc
·
1 Parent(s): 4ebb883
Files changed (1) hide show
  1. Dockerfile +12 -33
Dockerfile CHANGED
@@ -1,44 +1,23 @@
1
- # FROM node:23.7.0 as builder
2
-
3
- # # Install git
4
- # RUN apt-get update && apt-get install -y git
5
-
6
- # # Clone the GitHub repository
7
- # RUN if [ -d "/usr/src/app/.git" ]; then cd /usr/src/app && git pull; else git clone https://github.com/abubasith456/Node-WLA.git /usr/src/app; fi
8
-
9
- # # Set the working directory
10
- # WORKDIR /usr/src/app
11
-
12
- # # Install npm dependencies
13
- # RUN npm install
14
-
15
- # RUN npm ci
16
-
17
- # # Expose the port your application runs on
18
- # EXPOSE 5000
19
-
20
- # # Start the application
21
- # CMD ["npm", "start"]
22
-
23
-
24
-
25
- # Base image
26
  FROM node:23.7.0 as builder
27
 
28
- # Install required packages
29
  RUN apt-get update && apt-get install -y git
30
 
31
- # Clone the repository
32
  RUN if [ -d "/usr/src/app/.git" ]; then cd /usr/src/app && git pull; else git clone https://github.com/abubasith456/Node-WLA.git /usr/src/app; fi
33
 
34
  # Set the working directory
35
  WORKDIR /usr/src/app
36
 
37
- # Check if the repo contains a Dockerfile
38
- RUN if [ -f "Dockerfile" ]; then echo "Found Dockerfile in repo"; else echo "No Dockerfile found" && exit 1; fi
 
 
 
 
39
 
40
- # Build the repo's Docker image
41
- RUN docker build -t musfi-prod .
42
 
43
- # Run the final image
44
- CMD ["docker", "run", "-p", "5000:5000", "musfi-prod"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  FROM node:23.7.0 as builder
2
 
3
+ # Install git
4
  RUN apt-get update && apt-get install -y git
5
 
6
+ # Clone the GitHub repository
7
  RUN if [ -d "/usr/src/app/.git" ]; then cd /usr/src/app && git pull; else git clone https://github.com/abubasith456/Node-WLA.git /usr/src/app; fi
8
 
9
  # Set the working directory
10
  WORKDIR /usr/src/app
11
 
12
+ RUN ls
13
+
14
+ # Install npm dependencies
15
+ RUN npm install
16
+
17
+ RUN npm ci
18
 
19
+ # Expose the port your application runs on
20
+ EXPOSE 5000
21
 
22
+ # Start the application
23
+ CMD ["npm", "start"]