Fix: sql-mode / Many fixes
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
[mysqld]
|
[mysqld]
|
||||||
sql-mode = NO_ENGINE_SUBSTITUTION,NO_AUTO_VALUE_ON_ZERO
|
sql-mode = NO_ENGINE_SUBSTITUTION
|
||||||
character-set-server = utf8mb4
|
character-set-server = utf8mb4
|
||||||
collation-server = utf8mb4_general_ci
|
collation-server = utf8mb4_general_ci
|
||||||
default-storage-engine = InnoDB
|
default-storage-engine = InnoDB
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ services:
|
|||||||
- "${PUBLIC_PORT}:80"
|
- "${PUBLIC_PORT}:80"
|
||||||
volumes:
|
volumes:
|
||||||
- app_data:/var/www/html
|
- app_data:/var/www/html
|
||||||
- ./php/php.ini:/usr/local/etc/php/conf.d/99-custom.ini
|
|
||||||
environment:
|
environment:
|
||||||
- APACHE_DOCUMENT_ROOT=/var/www/html
|
- APACHE_DOCUMENT_ROOT=/var/www/html
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|||||||
+13
-18
@@ -4,6 +4,9 @@ FROM php:8.2-apache
|
|||||||
# Set working directory
|
# Set working directory
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
|
# Run as root
|
||||||
|
USER root
|
||||||
|
|
||||||
# Install packages(apt)
|
# Install packages(apt)
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -y dos2unix
|
RUN apt-get install -y dos2unix
|
||||||
@@ -20,11 +23,11 @@ RUN apt-get install -y curl
|
|||||||
RUN apt-get clean
|
RUN apt-get clean
|
||||||
RUN rm -rf /var/lib/apt/lists/*
|
RUN rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Copy uwuzu
|
# Copy app
|
||||||
COPY src /usr/src/app
|
COPY src/ /var/www/html/
|
||||||
RUN find /usr/src/app/ -type f -exec dos2unix {} \;
|
RUN find /var/www/html -type f -exec dos2unix {} \;
|
||||||
|
|
||||||
# Install packages(php)
|
# Install PHP extensions
|
||||||
RUN docker-php-ext-configure gd --with-freetype --with-webp
|
RUN docker-php-ext-configure gd --with-freetype --with-webp
|
||||||
RUN docker-php-ext-install gd
|
RUN docker-php-ext-install gd
|
||||||
RUN docker-php-ext-install pdo_mysql
|
RUN docker-php-ext-install pdo_mysql
|
||||||
@@ -43,18 +46,10 @@ COPY php/php.ini /usr/local/etc/php/conf.d/99-custom.ini
|
|||||||
COPY php/apache2.conf /etc/apache2/conf-enabled/99-custom.conf
|
COPY php/apache2.conf /etc/apache2/conf-enabled/99-custom.conf
|
||||||
|
|
||||||
# Set permissions
|
# Set permissions
|
||||||
USER root
|
RUN chown -R www-data:www-data /var/www/html
|
||||||
RUN chown -R www-data:www-data /usr/src/app
|
RUN find /var/www/html -type d -exec chmod 775 {} \;
|
||||||
RUN find /usr/src/app -type d -exec chmod 775 {} \;
|
RUN find /var/www/html -type f -exec chmod 664 {} \;
|
||||||
RUN find /usr/src/app -type f -exec chmod 664 {} \;
|
RUN chmod 777 /var/www/html
|
||||||
RUN chmod 777 /usr/src/app
|
|
||||||
|
|
||||||
# Copy entrypoint
|
# Start Apache
|
||||||
COPY php/entrypoint.sh /usr/src/entrypoint.sh
|
CMD ["apache2-foreground"]
|
||||||
RUN chmod +x /usr/src/entrypoint.sh
|
|
||||||
|
|
||||||
# Run as www-data
|
|
||||||
USER www-data
|
|
||||||
|
|
||||||
# Exec entrypoint
|
|
||||||
ENTRYPOINT ["/usr/src/entrypoint.sh"]
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
<Directory /var/www/html>
|
<Directory /var/www/html>
|
||||||
Options Indexes FollowSymLinks
|
Options Indexes FollowSymLinks
|
||||||
AllowOverride All
|
AllowOverride ALL
|
||||||
Require all granted
|
Require all granted
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -e
|
|
||||||
|
|
||||||
APP_DIR="/var/www/html"
|
|
||||||
SRC_DIR="/usr/src/app"
|
|
||||||
INIT_FLAG="$APP_DIR/.initialized"
|
|
||||||
|
|
||||||
if [ ! -f "$INIT_FLAG" ]; then
|
|
||||||
echo "[Init] Copying initial files to $APP_DIR..."
|
|
||||||
cp -rT "$SRC_DIR" "$APP_DIR"
|
|
||||||
chown -R www-data:www-data "$APP_DIR"
|
|
||||||
touch "$INIT_FLAG"
|
|
||||||
else
|
|
||||||
echo "[Init] Already initialized."
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec apache2-foreground
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user