Skip to content

Commit 2e7ec5f

Browse files
committed
Add crontab
Install crond daemon. Look for any files, in the directory /crontab (if exists). Try import each file as crontab and let it belong to the user, which file name maps to the username.
1 parent c728e52 commit 2e7ec5f

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN \
1616
# Install tools, required for building
1717
apt-get update && \
1818
apt-get install -y --no-install-recommends \
19-
# In general...
19+
# For building (will be removed)
2020
autoconf \
2121
build-essential \
2222
curl \
@@ -43,7 +43,10 @@ RUN \
4343
# For Honcho
4444
python \
4545
python-pip \
46-
python-pkg-resources && \
46+
python-pkg-resources \
47+
48+
# Fron crontab
49+
cron && \
4750

4851
pip install honcho && \
4952

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
nginx: /usr/local/sbin/nginx
22
phpfpm: /usr/local/sbin/php-fpm
3+
cron: /usr/sbin/cron -f

docker-entrypoint

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ if [[ $ENABLE_XDEBUG == "1" ]]; then
2222
echo "zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so" >> /usr/local/lib/php.ini
2323
fi
2424

25+
# Deploy available crontabs
26+
if [[ -d /crontab ]]; then
27+
for crontab_file in $(ls /crontab); do
28+
crontab -u $crontab_file /crontab/$crontab_file
29+
done
30+
fi
31+
32+
# Start Honcho
2533
if [[ $1 == "server" ]]; then
2634
exec honcho -d / start
2735
fi

0 commit comments

Comments
 (0)