Spaces:
Sleeping
Sleeping
abubasith86
commited on
Commit
·
2888a5b
1
Parent(s):
21e9c94
Docker config changed
Browse files- Dockerfile +38 -4
Dockerfile
CHANGED
@@ -1,7 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 (if not already cloned)
|
7 |
RUN rm -rf /usr/src/app && git clone https://github.com/abubasith456/Node-WLA.git /usr/src/app
|
@@ -19,8 +47,14 @@ RUN git config --global --add safe.directory /usr/src/app
|
|
19 |
# Install npm dependencies
|
20 |
RUN npm install
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
# Expose the port your application runs on
|
23 |
EXPOSE 5000
|
24 |
|
25 |
-
#
|
26 |
-
CMD
|
|
|
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 (if not already cloned)
|
7 |
+
# RUN rm -rf /usr/src/app && git clone https://github.com/abubasith456/Node-WLA.git /usr/src/app
|
8 |
+
|
9 |
+
# # Set the working directory
|
10 |
+
# WORKDIR /usr/src/app
|
11 |
+
|
12 |
+
# # Change ownership of the directory to the current user (node)
|
13 |
+
# RUN chown -R node:node /usr/src/app
|
14 |
+
|
15 |
+
# # Mark the repository directory as safe
|
16 |
+
# USER node
|
17 |
+
# RUN git config --global --add safe.directory /usr/src/app
|
18 |
+
|
19 |
+
# # Install npm dependencies
|
20 |
+
# RUN npm install
|
21 |
+
|
22 |
+
# # Expose the port your application runs on
|
23 |
+
# EXPOSE 5000
|
24 |
+
|
25 |
+
# # Ensure that the latest code is pulled before starting the app
|
26 |
+
# CMD git pull origin main && npm install && npm start
|
27 |
+
|
28 |
+
|
29 |
FROM node:23.7.0 as builder
|
30 |
|
31 |
+
# Install required dependencies (git & bash)
|
32 |
+
RUN apt-get update && apt-get install -y git bash
|
33 |
|
34 |
# Clone the GitHub repository (if not already cloned)
|
35 |
RUN rm -rf /usr/src/app && git clone https://github.com/abubasith456/Node-WLA.git /usr/src/app
|
|
|
47 |
# Install npm dependencies
|
48 |
RUN npm install
|
49 |
|
50 |
+
# Copy start_docker.sh script into the container
|
51 |
+
COPY start_docker.sh /usr/src/app/start_docker.sh
|
52 |
+
|
53 |
+
# Give execution permission
|
54 |
+
RUN chmod +x /usr/src/app/start_docker.sh
|
55 |
+
|
56 |
# Expose the port your application runs on
|
57 |
EXPOSE 5000
|
58 |
|
59 |
+
# Run the start_docker.sh script
|
60 |
+
CMD ["/bin/bash", "/usr/src/app/start_docker.sh"]
|