Add Docker configuration and fix paths

This commit is contained in:
nickpons666
2026-01-19 17:10:54 -06:00
parent 85894619d8
commit 6a1c86d88a
12 changed files with 152 additions and 6 deletions

25
Dockerfile Normal file
View File

@@ -0,0 +1,25 @@
FROM php:8.2-apache
RUN apt-get update && apt-get install -y \
cron \
nano \
libzip-dev \
zip \
unzip \
&& docker-php-ext-install pdo pdo_mysql \
&& a2enmod rewrite
COPY docker/contenedor-ibiza.conf /etc/apache2/sites-available/
WORKDIR /var/www/html
COPY . .
RUN chmod +x /var/www/html/scripts/*.php \
&& a2ensite contenedor-ibiza.conf \
&& a2dissite 000-default.conf \
&& crontab -l | { cat; echo "0 0 * * 0 /usr/bin/php /var/www/html/scripts/rotar_automatico.php >> /var/log/rotacion.log 2>&1"; } | crontab -
EXPOSE 80
CMD ["sh", "-c", "php /var/www/html/scripts/generate-env.php && apache2-foreground"]