Chg: Line Break & Fix: many fixes & Chg: README

This commit is contained in:
2025-10-31 19:04:16 +09:00
parent 0e6df50a7f
commit 283df57c20
10 changed files with 171 additions and 105 deletions
+1
View File
@@ -8,3 +8,4 @@ MARIADB_USER=uwuzu # ユーザー名
MARIADB_PASSWORD=password # パスワード MARIADB_PASSWORD=password # パスワード
MARIADB_TIME_ZONE=Azia/Tokyo # タイムゾーン MARIADB_TIME_ZONE=Azia/Tokyo # タイムゾーン
PUBLIC_MARIADB_PORT=3306 # 配信ポート # 外部にMariaDBを後悔しない場合は不要 PUBLIC_MARIADB_PORT=3306 # 配信ポート # 外部にMariaDBを後悔しない場合は不要
+1
View File
@@ -1,2 +1,3 @@
.env .env
src/ src/
+13 -16
View File
@@ -1,19 +1,16 @@
# uwuzuDocker Composeで動かすやつ # uwuzu for Docker Compose
## What is this uwuzuがDocker Composeで動きます。
uwuzu v1.6.5がDocker Composeで動きます ※一部バージョンでは動かない可能性があります。動作保証は致しません。また、セキュリティ上の問題が発生する可能性があるため本番環境では推奨しません
## 使い方 # 使い方
### .env ## /.env
.env.exampleの空気を読んでください .env.exampleのコメントに従って入力してください
### srcフォルダ ## /src
srcフォルダにuwuzuのZIPを展開してください。 srcフォルダにuwuzuのリポジトリで配布されているZIPファイルを展開してください。
v1.6.5は検証済みです。
### phpフォルダ・dbフォルダ ## /db・/php
MariaDB・PHP・Apacheの設定が色々あります。 設定ファイルやDockerfileなどがあります。
一旦v1.6.5用の設定があります。 動作しない場合は適宜修正してください。
これを読んでいる以上技術者ではあるはずなのでv1.6.5以上でこのリポジトリが更新されていないのに構造に破壊的変更があったら空気を読んでいじってください。 > [!NOTE]
> 余裕があればIssue・プルリクエストのご協力をお願いします。
# 結論
空気読めば動く
+1
View File
@@ -1 +1,2 @@
CREATE DATABASE uwuzu; CREATE DATABASE uwuzu;
+3 -1
View File
@@ -1,2 +1,4 @@
[mysqld] [mysqld]
sql_mode = NO_ENGINE_SUBSTITUTION sql_mode=NO_ENGINE_SUBSTITUTION
character-set-server = utf8mb4
collation-server = utf8mb4_general_ci
+7 -5
View File
@@ -1,12 +1,13 @@
services: services:
web: web:
build: build:
context: ./php context: .
container_name: php-apache-dev dockerfile: ./php/Dockerfile
container_name: web
ports: ports:
- "${PUBLIC_PORT}:80" - "${PUBLIC_PORT}:80"
volumes: volumes:
- ./src:/var/www/html - app_data:/var/www/html
- ./php/php.ini:/usr/local/etc/php/conf.d/99-custom.ini - ./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
@@ -17,7 +18,7 @@ services:
db: db:
image: mariadb:11.3 image: mariadb:11.3
container_name: mariadb-dev container_name: mariadb
restart: unless-stopped restart: unless-stopped
environment: environment:
MYSQL_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD} MYSQL_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
@@ -28,7 +29,7 @@ services:
volumes: volumes:
- db_data:/var/lib/mysql - db_data:/var/lib/mysql
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql - ./db/init.sql:/docker-entrypoint-initdb.d/init.sql
- ./db/my.cnf:/etc/mysql/conf.d/my.cnf - ./db/my.cnf:/etc/mysql/mariadb.conf.d/99-custom.cnf
ports: ports:
- "${PUBLIC_MARIADB_PORT}:3306" - "${PUBLIC_MARIADB_PORT}:3306"
networks: networks:
@@ -40,3 +41,4 @@ networks:
volumes: volumes:
db_data: db_data:
app_data:
+55 -13
View File
@@ -1,16 +1,58 @@
# Load php-apache
FROM php:8.2-apache FROM php:8.2-apache
RUN apt-get update # Set working directory
RUN apt-get install -y \ WORKDIR /var/www/html
libpng-dev \
libjpeg62-turbo-dev \ # Install packages(apt)
libfreetype6-dev \ RUN apt-get update
libonig-dev \ RUN apt-get install -y libpng-dev
libzip-dev \ RUN apt-get install -y libjpeg62-turbo-dev
zip \ RUN apt-get install -y libfreetype6-dev
unzip RUN apt-get install -y libonig-dev
RUN docker-php-ext-configure gd --with-freetype --with-jpeg RUN apt-get install -y libzip-dev
RUN docker-php-ext-install gd pdo_mysql mysqli mbstring zip fileinfo RUN apt-get install -y libcurl4-openssl-dev
RUN apt-get install -y zip
RUN apt-get install -y unzip
RUN apt-get install -y curl
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/*
# Copy uwuzu
COPY src /usr/src/app
# Install packages(php)
RUN docker-php-ext-configure gd --with-freetype --with-jpeg
RUN docker-php-ext-install gd
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install mysqli
RUN docker-php-ext-install mbstring
RUN docker-php-ext-install zip
RUN docker-php-ext-install fileinfo
RUN docker-php-ext-install curl
# Enable Apache modules
RUN a2enmod rewrite
RUN a2enmod headers
# Copy custom configuration
COPY php/php.ini /usr/local/etc/php/conf.d/99-custom.ini
COPY php/apache2.conf /etc/apache2/conf-enabled/99-custom.conf
# Set permissions
USER root
RUN chown -R www-data:www-data /usr/src/app
RUN find /usr/src/app -type d -exec chmod 775 {} \;
RUN find /usr/src/app -type f -exec chmod 664 {} \;
RUN chmod 777 /usr/src/app
# Copy entrypoint
COPY php/entrypoint.sh /usr/src/entrypoint.sh
RUN chmod +x /usr/src/entrypoint.sh
# Run as www-data
USER www-data
# Exec entrypoint
ENTRYPOINT ["/usr/src/entrypoint.sh"]
RUN a2enmod rewrite headers
COPY apache2.conf /etc/apache2/conf-enabled/99-custom.conf
+1
View File
@@ -7,3 +7,4 @@
ServerName localhost ServerName localhost
ServerAdmin webmaster@localhost ServerAdmin webmaster@localhost
DocumentRoot /var/www/html DocumentRoot /var/www/html
+18
View File
@@ -0,0 +1,18 @@
#!/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
+7 -6
View File
@@ -1,7 +1,8 @@
display_errors = Off display_errors = Off
extension=fileinfo display_startup_errors = Off
extension=gd log_errors = On
extension=pdo_mysql error_log = /proc/self/fd/2
extension=mysqli error_reporting = E_ALL & ~E_WARNING & ~E_NOTICE
extension=mbstring error_prepend_string =
extension=zip error_append_string =
default_charset = "UTF-8"