abubasith86 commited on
Commit
4ebb883
·
1 Parent(s): 1f24288

Docker added

Browse files
Files changed (1) hide show
  1. Dockerfile +33 -11
Dockerfile CHANGED
@@ -1,22 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
 
 
 
 
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"]