Dockerfile pour Coolify.

This commit is contained in:
William 2022-06-29 20:46:13 +02:00
parent d0b797477f
commit 0e7bb55369
2 changed files with 52 additions and 0 deletions

41
Dockerfile Normal file
View File

@ -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/*

11
vhost.conf Normal file
View File

@ -0,0 +1,11 @@
<VirtualHost *:80>
DocumentRoot /var/www/public
<Directory "/var/www">
AllowOverride all
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>