Feature: Reescribir configuración Docker completa
- Dockerfile: PHP 8.3 con Apache, copia todo el código a la imagen - docker-compose.yml: Sin volúmenes de código, usa env_file - supervisord.conf: Incluye Apache, Discord bot y colas de procesos - apache.conf: Configuración de virtualhost con rewrite - .dockerignore: Excluye archivos innecesarios de la imagen - Eliminados archivos duplicados de supervisor - Creada carpeta database/ para init scripts - Telegram funciona vía webhook (no necesita supervisor)
This commit is contained in:
@@ -1,19 +1,52 @@
|
||||
FROM php:8.2-cli
|
||||
FROM php:8.3-apache
|
||||
|
||||
# Instalar dependencias del sistema
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libcurl4-openssl-dev \
|
||||
libzip-dev \
|
||||
libpng-dev \
|
||||
libjpeg-dev \
|
||||
libfreetype6-dev \
|
||||
unzip \
|
||||
supervisor \
|
||||
nano \
|
||||
&& pecl install curl \
|
||||
&& docker-php-ext-enable curl \
|
||||
&& docker-php-ext-install pdo_mysql zip \
|
||||
cron \
|
||||
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||
&& docker-php-ext-install pdo_mysql zip gd curl \
|
||||
&& pecl install redis \
|
||||
&& docker-php-ext-enable redis \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Habilitar módulos de Apache
|
||||
RUN a2enmod rewrite headers ssl
|
||||
|
||||
# Copiar Composer
|
||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||
|
||||
WORKDIR /var/www/html
|
||||
# Crear directorio de logs
|
||||
RUN mkdir -p /var/www/html/logs && chown -R www-data:www-data /var/www/html/logs
|
||||
|
||||
CMD ["/usr/bin/supervisord", "-c", "/var/www/html/docker/supervisord.conf"]
|
||||
# Copiar configuración de Apache
|
||||
COPY docker/apache.conf /etc/apache2/sites-available/000-default.conf
|
||||
|
||||
# Copiar configuración de Supervisor
|
||||
COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
|
||||
# Copiar el proyecto completo
|
||||
COPY . /var/www/html/
|
||||
|
||||
# Instalar dependencias de PHP
|
||||
RUN composer install --no-dev --optimize-autoloader
|
||||
|
||||
# Permisos correctos
|
||||
RUN chown -R www-data:www-data /var/www/html \
|
||||
&& chmod -R 755 /var/www/html \
|
||||
&& chmod -R 775 /var/www/html/logs \
|
||||
&& chmod -R 775 /var/www/html/galeria
|
||||
|
||||
# Puerto expuesto
|
||||
EXPOSE 80
|
||||
|
||||
# Iniciar Apache y Supervisor
|
||||
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
||||
|
||||
Reference in New Issue
Block a user