-
-
Notifications
You must be signed in to change notification settings - Fork 40
/
Dockerfile
55 lines (48 loc) · 1.48 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
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
FROM bitnami/minideb:bullseye
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 \
git \
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/php8.2.list && \
## Install PHP 8.2
install_packages \
php8.2 \
php8.2-fpm \
php8.2-gd \
php8.2-curl \
php8.2-zip \
php8.2-mbstring \
php8.2-xml \
php8.2-intl
RUN \
## 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 && \
unzip /grav/grav.zip -d /var/www && \
rm /grav/grav.zip && \
rm -R /var/www/html && \
## Setup cron
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 - && \
## Nginx Logs
ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log
EXPOSE 80 443
COPY Docker/ /
RUN chmod +x /init
WORKDIR /var/www/grav
CMD ["/init"]