shashidharak99 commited on
Commit
f245764
·
verified ·
1 Parent(s): a87457c

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -0
Dockerfile ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:20
2
+
3
+ WORKDIR /app
4
+
5
+ RUN apt-get update && apt-get install -y git cron
6
+
7
+ # Clone initially
8
+ RUN git clone https://github.com/YOUR_USERNAME/YOUR_REPO.git project
9
+
10
+ WORKDIR /app/project
11
+
12
+ RUN npm install
13
+
14
+ # Copy scripts
15
+ WORKDIR /app
16
+ COPY update.sh .
17
+ COPY server.sh .
18
+
19
+ RUN chmod +x update.sh
20
+ RUN chmod +x server.sh
21
+
22
+ # Setup cron
23
+ RUN echo "0 * * * * /app/update.sh >> /var/log/cron.log 2>&1" > /etc/cron.d/update-cron
24
+ RUN chmod 0644 /etc/cron.d/update-cron
25
+ RUN crontab /etc/cron.d/update-cron
26
+
27
+ EXPOSE 7860
28
+
29
+ CMD ["/app/server.sh"]