Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +15 -18
Dockerfile
CHANGED
|
@@ -1,29 +1,26 @@
|
|
| 1 |
FROM node:20
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 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
|
| 18 |
|
|
|
|
| 19 |
RUN chmod +x update.sh
|
| 20 |
-
RUN chmod +x server.sh
|
| 21 |
|
| 22 |
-
#
|
| 23 |
-
RUN echo "0 * * * * /app/update.sh >> /var/log/cron.log 2>&1" > /etc/cron.d/
|
| 24 |
-
|
| 25 |
-
RUN
|
|
|
|
|
|
|
| 26 |
|
| 27 |
EXPOSE 7860
|
| 28 |
|
| 29 |
-
CMD ["/app/
|
|
|
|
| 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"]
|