-
Notifications
You must be signed in to change notification settings - Fork 15
/
Dockerfile.cron.8.1
95 lines (72 loc) · 2.57 KB
/
Dockerfile.cron.8.1
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
FROM php:8.1-apache
# Add apache and php config for Laravel
COPY ./site.conf /etc/apache2/sites-available/site.conf
RUN ln -s /etc/apache2/sites-available/site.conf /etc/apache2/sites-enabled/
#RUN sed -i 's/Listen 80/Listen 8000/g' /etc/apache2/ports.conf
RUN a2dissite 000-default.conf && a2ensite site.conf && a2enmod rewrite && a2enmod headers
# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Copy composer.lock and composer.json
#COPY composer.lock composer.json /var/www/
# Set working directory
WORKDIR /var/www
# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
mariadb-client \
libpng-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
locales \
zip \
jpegoptim optipng pngquant gifsicle \
vim \
unzip \
git \
curl \
libzip-dev \
libpq-dev \
cron \
wget \
&& docker-php-ext-install opcache \
&& docker-php-ext-configure pgsql \
&& docker-php-ext-install pdo pdo_pgsql \
&& docker-php-ext-install sockets \
&& pecl install apcu && docker-php-ext-enable apcu opcache
RUN apt-get install libonig-dev -y
RUN docker-php-ext-install pdo pdo_mysql mbstring zip exif pcntl
RUN docker-php-ext-configure gd --with-freetype=/usr/include/
RUN docker-php-ext-install gd
RUN apt-get install -y locales locales-all
ENV LC_ALL en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US.UTF-8
#New Relic
RUN export NR_VERSION=$(curl -sS https://download.newrelic.com/php_agent/release/ | sed -n 's/.*>\(.*linux\).tar.gz<.*/\1/p') \
&& wget https://download.newrelic.com/php_agent/release/${NR_VERSION}.tar.gz && \
tar -xzf ${NR_VERSION}.tar.gz && \
mv ${NR_VERSION} newrelic
# Change uid and gid of apache to docker user uid/gid
RUN usermod -u 1000 www-data && groupmod -g 1000 www-data
WORKDIR /var/www/html
# Copy the PHP configuration file
COPY ./php.ini /usr/local/etc/php/
# Cron Jobs
# Copy hello-cron file to the cron.d directory
COPY ./scheduler.cron /etc/cron.d/root
# Give execution rights on the cron job
RUN chmod 0644 /etc/cron.d/root
# Apply cron job
RUN crontab /etc/cron.d/root
RUN touch /var/log/cron.log
COPY . .
ARG H5PBRANCH
ENV H5P_BRANCH=$H5PBRANCH
RUN echo $H5P_BRANCH
RUN echo $H5PBRANCH
RUN git clone -b $H5PBRANCH https://github.com/ActiveLearningStudio/H5P.Distribution.git h5pcode
RUN composer install --no-dev --prefer-dist --optimize-autoloader && \
composer clear-cache
COPY ./entrypoint.cron.sh ./
RUN chmod +x /var/www/html/entrypoint.cron.sh
ENTRYPOINT ["sh", "/var/www/html/entrypoint.cron.sh"]