From 0e7bb55369438b0bb7f6be2572c04d2a1bafdb95 Mon Sep 17 00:00:00 2001 From: William Date: Wed, 29 Jun 2022 20:46:13 +0200 Subject: [PATCH] Dockerfile pour Coolify. --- Dockerfile | 41 +++++++++++++++++++++++++++++++++++++++++ vhost.conf | 11 +++++++++++ 2 files changed, 52 insertions(+) create mode 100644 Dockerfile create mode 100644 vhost.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8213ab5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,41 @@ +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 + +# Get latest Composer +RUN php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer + +# Copy source code +COPY . /var/www + +# Install php dependencies +RUN composer install --quiet --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist + +# Clean cache +RUN apt-get -y autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/vhost.conf b/vhost.conf new file mode 100644 index 0000000..2050d8f --- /dev/null +++ b/vhost.conf @@ -0,0 +1,11 @@ + + DocumentRoot /var/www/public + + + AllowOverride all + Require all granted + + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined +