Initial commit: plantilla base PHP para webs Acai CMS

This commit is contained in:
Jordan
2026-02-21 21:13:57 +00:00
commit 03acc5b013
321 changed files with 62660 additions and 0 deletions

36
.docker/Dockerfile Normal file
View File

@@ -0,0 +1,36 @@
FROM php:8.2-apache
# Instalar dependencias para GD
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libwebp-dev \
libzip-dev \
&& rm -rf /var/lib/apt/lists/*
# Configurar y instalar extensiones PHP
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install -j$(nproc) gd mysqli pdo pdo_mysql zip
# Instalar extension Redis
RUN pecl install redis && docker-php-ext-enable redis
# short_open_tag
RUN echo "short_open_tag = On" > /usr/local/etc/php/conf.d/short-tags.ini
# Modulos Apache
RUN a2enmod rewrite headers deflate expires
# AllowOverride All para .htaccess
RUN sed -i '/<Directory \/var\/www\/>/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf && \
sed -i '/<Directory \/var\/www\/>/,/<\/Directory>/ s/Options Indexes FollowSymLinks/Options Indexes FollowSymLinks/' /etc/apache2/apache2.conf
# ServerName
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
# Cliente MariaDB para importar SQL
RUN apt-get update && apt-get install -y mariadb-client && rm -rf /var/lib/apt/lists/*
WORKDIR /var/www/html
EXPOSE 80

View File

@@ -0,0 +1,64 @@
services:
web:
build: .
container_name: dw-quantumasis-web-completa-web
labels:
docker-web: "true"
docker-web-project: "quantumasis-web-completa"
ports:
- "8080:80"
volumes:
- /Users/jordandiaz/Documents/GitHub/quantumasis-web-completa:/var/www/html
- ./init.sh:/docker-entrypoint-init.d/init.sh
- ./quantu_web2134-209-184-114-2-2619-49.sql:/docker-entrypoint-init.d/quantu_web2134-209-184-114-2-2619-49.sql
environment:
- DB_SERVER=${DB_SERVER}
- DB_DATABASE=${DB_DATABASE}
- DB_USERNAME=${DB_USERNAME}
- DB_PASSWORD=${DB_PASSWORD}
depends_on:
db:
condition: service_healthy
command: >
bash -c "chmod +x /docker-entrypoint-init.d/init.sh &&
/docker-entrypoint-init.d/init.sh &&
apache2-foreground"
db:
image: mariadb:10.11
container_name: dw-quantumasis-web-completa-db
labels:
docker-web: "true"
docker-web-project: "quantumasis-web-completa"
environment:
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD}
- MYSQL_DATABASE=${DB_DATABASE}
- MYSQL_USER=${DB_USERNAME}
- MYSQL_PASSWORD=${DB_PASSWORD}
volumes:
- db_data:/var/lib/mysql
ports:
- "33060:3306"
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: dw-quantumasis-web-completa-redis
labels:
docker-web: "true"
docker-web-project: "quantumasis-web-completa"
restart: unless-stopped
network_mode: "service:web"
depends_on:
- web
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
volumes:
db_data:

21
.docker/init.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
echo "Esperando a que la base de datos este lista..."
sleep 5
TABLE_COUNT=$(mysql -h"$DB_SERVER" -u"$DB_USERNAME" -p"$DB_PASSWORD" "$DB_DATABASE" --skip-ssl -e "SHOW TABLES;" 2>/dev/null | wc -l)
if [ "$TABLE_COUNT" -le 1 ]; then
SQL_FILE=$(find /docker-entrypoint-init.d/ -name "*.sql" -type f 2>/dev/null | head -1)
if [ -n "$SQL_FILE" ]; then
echo "Importando base de datos desde $SQL_FILE..."
mysql -h"$DB_SERVER" -u"$DB_USERNAME" -p"$DB_PASSWORD" "$DB_DATABASE" --skip-ssl < "$SQL_FILE"
echo "Base de datos importada correctamente."
else
echo "Advertencia: No se encontro archivo .sql para importar"
fi
else
echo "La base de datos ya contiene $TABLE_COUNT tablas. Omitiendo importacion."
fi
echo "Inicializacion completada."