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.
55 lines
1.8 KiB
55 lines
1.8 KiB
FROM php:7.4-apache |
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|
$PHPIZE_DEPS \ |
|
libpq-dev libicu-dev libzip-dev zlib1g-dev libonig-dev \ |
|
libfreetype6-dev libjpeg62-turbo-dev libpng-dev \ |
|
libcurl4-openssl-dev \ |
|
git unzip curl ca-certificates \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \ |
|
&& docker-php-ext-install -j"$(nproc)" \ |
|
pdo_pgsql mbstring curl gd intl zip |
|
|
|
RUN pecl install apcu \ |
|
&& docker-php-ext-enable apcu \ |
|
&& apt-get purge -y --auto-remove $PHPIZE_DEPS || true |
|
|
|
RUN { \ |
|
echo "max_input_vars = 2000"; \ |
|
echo "allow_url_fopen = On"; \ |
|
echo "memory_limit = 512M"; \ |
|
echo "upload_max_filesize = 50M"; \ |
|
echo "post_max_size = 50M"; \ |
|
} > /usr/local/etc/php/conf.d/custom.ini |
|
|
|
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer |
|
|
|
RUN curl -L -o /usr/local/bin/yuicompressor.jar \ |
|
https://github.com/yui/yuicompressor/releases/download/v2.4.8/yuicompressor-2.4.8.jar |
|
|
|
RUN a2enmod rewrite headers ssl |
|
|
|
WORKDIR /var/www/html |
|
|
|
# Copiar código directamente con dueño correcto |
|
COPY --chown=www-data:www-data . /var/www/html/ |
|
|
|
RUN composer install --prefer-dist --no-dev --optimize-autoloader || true |
|
|
|
# Crear solo carpetas necesarias con permisos |
|
RUN mkdir -p /var/www/html/instalacion/{temp,log,cache} \ |
|
&& chown -R www-data:www-data /var/www/html/instalacion/{temp,log,cache} \ |
|
&& chmod -R 777 /var/www/html/instalacion/{temp,log,cache} |
|
|
|
COPY docker/apache-config.conf /etc/apache2/sites-available/000-default.conf |
|
|
|
# Copiar rewrite.conf (asegurar ruta correcta) |
|
COPY instalacion/rewrite.conf /var/www/html/instalacion/rewrite.conf |
|
|
|
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"]
|
|
|