You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
2.4 KiB
78 lines
2.4 KiB
FROM php:7.4-apache |
|
|
|
# Instalar dependencias del sistema |
|
RUN apt-get update && apt-get install -y \ |
|
libpq-dev \ |
|
libicu-dev \ |
|
libzip-dev \ |
|
libonig-dev \ |
|
libfreetype6-dev \ |
|
libjpeg62-turbo-dev \ |
|
libpng-dev \ |
|
git \ |
|
unzip \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
# Instalar extensiones PHP requeridas |
|
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \ |
|
&& docker-php-ext-install -j$(nproc) \ |
|
pdo_pgsql \ |
|
mbstring \ |
|
curl \ |
|
openssl \ |
|
apcu \ |
|
gd \ |
|
intl \ |
|
zip |
|
|
|
# Configurar PHP |
|
RUN echo "max_input_vars = 2000" >> /usr/local/etc/php/conf.d/custom.ini \ |
|
&& echo "allow_url_fopen = On" >> /usr/local/etc/php/conf.d/custom.ini \ |
|
&& echo "memory_limit = 512M" >> /usr/local/etc/php/conf.d/custom.ini \ |
|
&& echo "upload_max_filesize = 50M" >> /usr/local/etc/php/conf.d/custom.ini \ |
|
&& echo "post_max_size = 50M" >> /usr/local/etc/php/conf.d/custom.ini |
|
|
|
# Instalar Composer |
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer |
|
|
|
# Instalar yui-compressor |
|
RUN curl -L -o yuicompressor-2.4.8.jar https://github.com/yui/yuicompressor/releases/download/v2.4.8/yuicompressor-2.4.8.jar \ |
|
&& mv yuicompressor-2.4.8.jar /usr/local/bin/yuicompressor.jar |
|
|
|
# Configurar Apache |
|
RUN a2enmod rewrite \ |
|
&& a2enmod headers \ |
|
&& a2enmod ssl |
|
|
|
# Crear directorio de trabajo |
|
WORKDIR /var/www/html |
|
|
|
# Copiar archivos del proyecto |
|
COPY . /var/www/html/ |
|
|
|
# Instalar dependencias de Composer |
|
RUN composer install --prefer-dist --no-dev --optimize-autoloader |
|
|
|
# Configurar permisos |
|
RUN chown -R www-data:www-data /var/www/html \ |
|
&& chmod -R 755 /var/www/html \ |
|
&& mkdir -p /var/www/html/instalacion/temp \ |
|
&& mkdir -p /var/www/html/instalacion/log \ |
|
&& mkdir -p /var/www/html/instalacion/cache \ |
|
&& chown -R www-data:www-data /var/www/html/instalacion/temp \ |
|
&& chown -R www-data:www-data /var/www/html/instalacion/log \ |
|
&& chown -R www-data:www-data /var/www/html/instalacion/cache \ |
|
&& chmod -R 777 /var/www/html/instalacion/temp \ |
|
&& chmod -R 777 /var/www/html/instalacion/log \ |
|
&& chmod -R 777 /var/www/html/instalacion/cache |
|
|
|
# Configurar Apache para el proyecto |
|
COPY docker/apache-config.conf /etc/apache2/sites-available/000-default.conf |
|
|
|
# Script de inicialización |
|
COPY docker/init.sh /usr/local/bin/init.sh |
|
RUN chmod +x /usr/local/bin/init.sh |
|
|
|
EXPOSE 80 |
|
|
|
CMD ["/usr/local/bin/init.sh"]
|
|
|