Browse Source

Ajout de cron

Ajout de cron
pascal.pp 3 years ago
parent
commit
5e1249ffa6
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 openssl
@@ -48,3 +48,18 @@ RUN docker-php-ext-install -j$(nproc) gd
48 48
 
49 49
 # Enable apache modules
50 50
 RUN a2enmod rewrite headers
51
+
52
+# Copy hello-cron file to the cron.d directory
53
+#COPY hello-cron /etc/cron.d/hello-cron
54
+
55
+# Give execution rights on the cron job
56
+#RUN chmod 0644 /etc/cron.d/hello-cron
57
+
58
+# Apply cron job
59
+#RUN crontab /etc/cron.d/hello-cron
60
+
61
+# Create the log file to be able to run tail
62
+RUN touch /var/log/cron.log
63
+
64
+# Run the command on container startup
65
+CMD cron && tail -f /var/log/cron.log

Loading…
Cancel
Save