From 4df4c1f02345f1f45243950e1ff95aa71409974c Mon Sep 17 00:00:00 2001 From: William Date: Wed, 29 Jun 2022 21:38:43 +0200 Subject: [PATCH] =?UTF-8?q?Pti=20script=20PHP=20conteneuris=C3=A9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 36 ++++++++++++++++++++++++++++++++++++ public/index.php | 3 +++ vhost.conf | 11 +++++++++++ 3 files changed, 50 insertions(+) create mode 100644 Dockerfile create mode 100644 public/index.php create mode 100644 vhost.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..00da9a2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +FROM php:8.1-apache-buster + +# Set working directory +WORKDIR /var/www + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + git \ + curl \ + libpng-dev \ + libjpeg-dev \ + libfreetype6-dev \ + libonig-dev \ + libxml2-dev \ + libpq-dev \ + libzip-dev \ + libcurl4-openssl-dev \ + zip \ + unzip \ + default-mysql-client + +# Copy vhost config +COPY vhost.conf /etc/apache2/sites-available/000-default.conf + +# Install PHP extensions +RUN docker-php-ext-configure gd --with-freetype --with-jpeg \ + && docker-php-ext-install pdo pdo_mysql mbstring exif pcntl bcmath gd zip curl intl + +# Clean cache +RUN apt-get -y autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# Copy source code +COPY . /var/www + diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..65bfbca --- /dev/null +++ b/public/index.php @@ -0,0 +1,3 @@ + + DocumentRoot /var/www/public + + + AllowOverride all + Require all granted + + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined +