Spaces:
Sleeping
Sleeping
abubasith86
commited on
Commit
·
5d635fb
1
Parent(s):
0c972c9
Test
Browse files- Dockerfile +8 -6
Dockerfile
CHANGED
@@ -28,16 +28,16 @@
|
|
28 |
|
29 |
FROM node:23.7.0 as builder
|
30 |
|
31 |
-
# Install required dependencies (git
|
32 |
-
RUN apt-get update && apt-get install -y git bash
|
33 |
|
34 |
-
# Clone the GitHub repository
|
35 |
RUN rm -rf /usr/src/app && git clone https://github.com/abubasith456/Node-WLA.git /usr/src/app
|
36 |
|
37 |
# Set the working directory
|
38 |
WORKDIR /usr/src/app
|
39 |
|
40 |
-
# Change ownership of the directory
|
41 |
RUN chown -R node:node /usr/src/app
|
42 |
|
43 |
# Mark the repository directory as safe
|
@@ -47,10 +47,12 @@ RUN git config --global --add safe.directory /usr/src/app
|
|
47 |
# Install npm dependencies
|
48 |
RUN npm install
|
49 |
|
50 |
-
# Give execution permission
|
51 |
RUN chmod +x /usr/src/app/start_docker.sh
|
52 |
|
53 |
# Expose the port your application runs on
|
54 |
EXPOSE 5000
|
55 |
|
56 |
-
|
|
|
|
|
|
28 |
|
29 |
FROM node:23.7.0 as builder
|
30 |
|
31 |
+
# Install required dependencies (git, bash, docker-compose)
|
32 |
+
RUN apt-get update && apt-get install -y git bash docker-compose
|
33 |
|
34 |
+
# Clone the GitHub repository
|
35 |
RUN rm -rf /usr/src/app && git clone https://github.com/abubasith456/Node-WLA.git /usr/src/app
|
36 |
|
37 |
# Set the working directory
|
38 |
WORKDIR /usr/src/app
|
39 |
|
40 |
+
# Change ownership of the directory
|
41 |
RUN chown -R node:node /usr/src/app
|
42 |
|
43 |
# Mark the repository directory as safe
|
|
|
47 |
# Install npm dependencies
|
48 |
RUN npm install
|
49 |
|
50 |
+
# Give execution permission to the script
|
51 |
RUN chmod +x /usr/src/app/start_docker.sh
|
52 |
|
53 |
# Expose the port your application runs on
|
54 |
EXPOSE 5000
|
55 |
|
56 |
+
# Start the script and keep the container running
|
57 |
+
CMD ["bash", "-c", "git pull origin main && /usr/src/app/start_docker.sh && tail -f /dev/null"]
|
58 |
+
|