Commit af3cd200 authored by AGLANPC\aglan's avatar AGLANPC\aglan

dfh xfcjfgx

parent a4661ecb
FROM php:8.2-apache FROM php:8.2-apache
# ── System deps ──────────────────────────────────────────────────────────────
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
libpng-dev libjpeg-dev libfreetype6-dev \ libpng-dev libjpeg-dev libfreetype6-dev \
libzip-dev libonig-dev libxml2-dev \ libzip-dev libonig-dev libxml2-dev \
...@@ -9,7 +8,6 @@ RUN apt-get update && apt-get install -y \ ...@@ -9,7 +8,6 @@ RUN apt-get update && apt-get install -y \
&& docker-php-ext-install pdo pdo_mysql mbstring zip gd xml opcache \ && docker-php-ext-install pdo pdo_mysql mbstring zip gd xml opcache \
&& apt-get clean && rm -rf /var/lib/apt/lists/* && apt-get clean && rm -rf /var/lib/apt/lists/*
# ── Apache config ────────────────────────────────────────────────────────────
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public ENV APACHE_DOCUMENT_ROOT=/var/www/html/public
RUN sed -i 's|DocumentRoot /var/www/html|DocumentRoot /var/www/html/public|g' \ RUN sed -i 's|DocumentRoot /var/www/html|DocumentRoot /var/www/html/public|g' \
...@@ -20,7 +18,6 @@ RUN sed -i 's|DocumentRoot /var/www/html|DocumentRoot /var/www/html/public|g' \ ...@@ -20,7 +18,6 @@ RUN sed -i 's|DocumentRoot /var/www/html|DocumentRoot /var/www/html/public|g' \
>> /etc/apache2/apache2.conf \ >> /etc/apache2/apache2.conf \
&& a2enmod rewrite && a2enmod rewrite
# ── PHP settings (errors ON for now so we can debug) ─────────────────────────
RUN echo "display_errors = On\n\ RUN echo "display_errors = On\n\
error_reporting = E_ALL\n\ error_reporting = E_ALL\n\
log_errors = On\n\ log_errors = On\n\
...@@ -36,7 +33,9 @@ RUN echo "display_errors = On\n\ ...@@ -36,7 +33,9 @@ RUN echo "display_errors = On\n\
WORKDIR /var/www/html WORKDIR /var/www/html
COPY . . COPY . .
# ── Make sure public/.htaccess exists for routing ──────────────────────────── # ── Symlink modules into public so Apache can serve CSS/JS ───────────────────
RUN ln -s /var/www/html/modules /var/www/html/public/modules
RUN if [ ! -f public/.htaccess ]; then \ RUN if [ ! -f public/.htaccess ]; then \
echo '<IfModule mod_rewrite.c>\n\ echo '<IfModule mod_rewrite.c>\n\
RewriteEngine On\n\ RewriteEngine On\n\
...@@ -46,11 +45,9 @@ RUN if [ ! -f public/.htaccess ]; then \ ...@@ -46,11 +45,9 @@ RUN if [ ! -f public/.htaccess ]; then \
</IfModule>' > public/.htaccess; \ </IfModule>' > public/.htaccess; \
fi fi
# ── Directories & permissions ────────────────────────────────────────────────
RUN mkdir -p storage/logs storage/uploads \ RUN mkdir -p storage/logs storage/uploads \
&& chown -R www-data:www-data /var/www/html \ && chown -R www-data:www-data /var/www/html \
&& chmod -R 775 storage && chmod -R 775 storage
EXPOSE 80 EXPOSE 80
CMD ["apache2-foreground"] CMD ["apache2-foreground"]
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment