shashidharak99 commited on
Commit
1b332a2
·
verified ·
1 Parent(s): 939b06a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -18
Dockerfile CHANGED
@@ -1,29 +1,26 @@
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"]
 
1
  FROM node:20
2
 
3
+ RUN apt-get update && apt-get install -y \
4
+ git \
5
+ cron \
6
+ nginx
 
 
 
 
7
 
 
 
 
8
  WORKDIR /app
9
+
10
+ COPY start.sh .
11
  COPY update.sh .
12
+ COPY nginx.conf /etc/nginx/sites-available/default
13
 
14
+ RUN chmod +x start.sh
15
  RUN chmod +x update.sh
 
16
 
17
+ # Cron Job -> every hour
18
+ RUN echo "0 * * * * /app/update.sh >> /var/log/cron.log 2>&1" > /etc/cron.d/react-cron
19
+
20
+ RUN chmod 0644 /etc/cron.d/react-cron
21
+
22
+ RUN crontab /etc/cron.d/react-cron
23
 
24
  EXPOSE 7860
25
 
26
+ CMD ["/app/start.sh"]