From 9bff3f1ba8c7296ccdd8c4bb184c1156f66831b4 Mon Sep 17 00:00:00 2001
From: "Bruno P. Kinoshita" <kinow@users.noreply.github.com>
Date: Tue, 15 Feb 2022 19:21:15 +1300
Subject: [PATCH] Update Dockerfile to support PHP 8

---
 dockerfiles/Dockerfile.ubuntu | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/dockerfiles/Dockerfile.ubuntu b/dockerfiles/Dockerfile.ubuntu
index d834ce428..81c917404 100644
--- a/dockerfiles/Dockerfile.ubuntu
+++ b/dockerfiles/Dockerfile.ubuntu
@@ -8,6 +8,9 @@ ARG SKOSMOS_VERSION=v.2.9
 
 ARG DEBIAN_FRONTEND=noninteractive
 
+# TODO: maybe find an image that comes with PHP 8 instead
+RUN apt-get update && apt-get install -y software-properties-common && add-apt-repository -y ppa:ondrej/php
+
 # git is necessary for some composer packages e.g. davidstutz/bootstrap-multiselect
 # gettext is necessary as php-gettext was available in 18.04, but not in 20.04
 RUN apt-get update && apt-get install -y \
@@ -15,15 +18,15 @@ RUN apt-get update && apt-get install -y \
     curl \
     gettext \
     git \
-    libapache2-mod-php7.4 \
+    libapache2-mod-php8.0 \
     locales \
-    php7.4 \
-    php7.4-curl \
-    php7.4-xsl \
-    php7.4-intl \
-    php7.4-mbstring \
-    php-apcu \
-    php-zip \
+    php8.0 \
+    php8.0-curl \
+    php8.0-xsl \
+    php8.0-intl \
+    php8.0-mbstring \
+    php8.0-apcu \
+    php8.0-zip \
     unzip \
  && rm -rf /var/lib/apt/lists/*
 
@@ -55,7 +58,7 @@ ENV LC_ALL=en_US.UTF-8
 ENV LANG=en_US.UTF-8  
 
 # timezone
-RUN sed -i 's/;date.timezone =/date.timezone = "UTC"/g' /etc/php/7.4/apache2/php.ini
+RUN sed -i 's/;date.timezone =/date.timezone = "UTC"/g' /etc/php/8.0/apache2/php.ini
 
 COPY dockerfiles/config/000-default.conf /etc/apache2/sites-available/000-default.conf