Browse Source

Ajout de cron

Ajout de cron
pascal.pp 3 years ago
parent
commit
3b9627701e
1 changed files with 16 additions and 1 deletions
  1. 16
    1
      bin/webserver/Dockerfile

+ 16
- 1
bin/webserver/Dockerfile View File

@@ -4,7 +4,7 @@ RUN apt-get -y update --fix-missing
4 4
 RUN apt-get upgrade -y
5 5
 
6 6
 # Install useful tools
7
-RUN apt-get -y install apt-utils nano wget dialog
7
+RUN apt-get -y install apt-utils nano wget dialog cron
8 8
 
9 9
 # Install important libraries
10 10
 RUN apt-get -y install --fix-missing apt-utils build-essential git curl libcurl3 libcurl3-dev zip
@@ -44,3 +44,18 @@ RUN docker-php-ext-install -j$(nproc) gd
44 44
 
45 45
 # Enable apache modules
46 46
 RUN a2enmod rewrite headers
47
+
48
+# Copy hello-cron file to the cron.d directory
49
+#COPY hello-cron /etc/cron.d/hello-cron
50
+
51
+# Give execution rights on the cron job
52
+#RUN chmod 0644 /etc/cron.d/hello-cron
53
+
54
+# Apply cron job
55
+#RUN crontab /etc/cron.d/hello-cron
56
+
57
+# Create the log file to be able to run tail
58
+RUN touch /var/log/cron.log
59
+
60
+# Run the command on container startup
61
+CMD cron && tail -f /var/log/cron.log

Loading…
Cancel
Save