forked from dsavell/docker-grav
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.gravcore
51 lines (46 loc) · 1.59 KB
/
Dockerfile.gravcore
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
FROM bitnami/minideb:buster
RUN \
## Docker User
useradd -u 911 -U -d /var/www -s /bin/false xyz && \
usermod -G users xyz && \
## Install Pre-reqs
install_packages \
apt-transport-https \
ca-certificates \
curl \
lsb-release \
nginx \
unzip \
cron \
wget && \
## Install PHP APT Repository
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php7.4.list && \
## Install PHP 7.4
install_packages \
php7.4 \
php7.4-fpm \
php7.4-gd \
php7.4-curl \
php7.4-zip \
php7.4-mbstring \
php7.4-xml \
php7.4-intl && \
## Download GRAV
mkdir -p \
/grav && \
GRAV_VERSION=$(curl -sX GET "https://api.github.com/repos/getgrav/grav/releases/latest" | awk '/tag_name/{print $4;exit}' FS='[""]') && \
curl -o /grav/grav.zip -L https://github.com/getgrav/grav/releases/download/${GRAV_VERSION}/grav-v${GRAV_VERSION}.zip && \
## Setup cron to make control console green
touch /var/spool/cron/crontabs/xyz && \
(crontab -l; echo "* * * * * cd /var/www/grav;/usr/bin/php bin/grav scheduler 1>> /dev/null 2>&1") | crontab -u xyz - && \
chown xyz /var/spool/cron/crontabs/xyz && \
## Setup cron that really works
(crontab -l; echo "* * * * * cd /var/www/grav;/usr/bin/php bin/grav scheduler 1>> /dev/null 2>&1") | crontab - && \
## Nginx Logs
ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log
EXPOSE 80 443
COPY root/ /
WORKDIR /var/www/grav
CMD ["/init-core"]