forked from DO-Solutions/app-platform-cron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
27 lines (22 loc) · 1.08 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Use the official PHP image as the base image
FROM php:8.1-fpm
# Install necessary packages for Equalify, including cron and curl
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install -y cron curl \
# Remove package lists for smaller image sizes
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install pdo pdo_mysql \
# Install Composer
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Copy the crontab file and entrypoint script into the container
COPY crontab /equalify-cron
COPY entrypoint.sh /entrypoint.sh
# Install the crontab and make the entrypoint script executable
RUN crontab /equalify-cron \
&& chmod +x /entrypoint.sh
# Run the entrypoint script
ENTRYPOINT ["/entrypoint.sh"]
# https://manpages.ubuntu.com/manpages/trusty/man8/cron.8.html
# -f | Stay in foreground mode, don't daemonize.
# -L loglevel | Tell cron what to log about jobs (errors are logged regardless of this value) as the sum of the following values:
CMD ["cron", "-f", "-L", "2"]