Chg: Line Break & Fix: many fixes & Chg: README
This commit is contained in:
+10
-9
@@ -1,10 +1,11 @@
|
|||||||
# Apache
|
# Apache
|
||||||
PUBLIC_PORT=80 # 配信ポート
|
PUBLIC_PORT=80 # 配信ポート
|
||||||
|
|
||||||
|
# MariaDB
|
||||||
|
MARIADB_ROOT_PASSWORD=rootpass # ルートパスワード
|
||||||
|
MARIADB_DATABASE=uwuzu # データベース
|
||||||
|
MARIADB_USER=uwuzu # ユーザー名
|
||||||
|
MARIADB_PASSWORD=password # パスワード
|
||||||
|
MARIADB_TIME_ZONE=Azia/Tokyo # タイムゾーン
|
||||||
|
PUBLIC_MARIADB_PORT=3306 # 配信ポート # 外部にMariaDBを後悔しない場合は不要
|
||||||
|
|
||||||
# MariaDB
|
|
||||||
MARIADB_ROOT_PASSWORD=rootpass # ルートパスワード
|
|
||||||
MARIADB_DATABASE=uwuzu # データベース
|
|
||||||
MARIADB_USER=uwuzu # ユーザー名
|
|
||||||
MARIADB_PASSWORD=password # パスワード
|
|
||||||
MARIADB_TIME_ZONE=Azia/Tokyo # タイムゾーン
|
|
||||||
PUBLIC_MARIADB_PORT=3306 # 配信ポート # 外部にMariaDBを後悔しない場合は不要
|
|
||||||
|
|||||||
+3
-2
@@ -1,2 +1,3 @@
|
|||||||
.env
|
.env
|
||||||
src/
|
src/
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,16 @@
|
|||||||
# uwuzuをDocker 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は検証済みです。
|
|
||||||
|
## /db・/php
|
||||||
### phpフォルダ・dbフォルダ
|
設定ファイルやDockerfileなどがあります。
|
||||||
MariaDB・PHP・Apacheの設定が色々あります。
|
動作しない場合は適宜修正してください。
|
||||||
一旦v1.6.5用の設定があります。
|
> [!NOTE]
|
||||||
これを読んでいる以上技術者ではあるはずなのでv1.6.5以上でこのリポジトリが更新されていないのに構造に破壊的変更があったら空気を読んでいじってください。
|
> 余裕があればIssue・プルリクエストのご協力をお願いします。
|
||||||
|
|
||||||
# 結論
|
|
||||||
空気読めば動く
|
|
||||||
|
|||||||
+2
-1
@@ -1 +1,2 @@
|
|||||||
CREATE DATABASE uwuzu;
|
CREATE DATABASE uwuzu;
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
+44
-42
@@ -1,42 +1,44 @@
|
|||||||
services:
|
services:
|
||||||
web:
|
web:
|
||||||
build:
|
build:
|
||||||
context: ./php
|
context: .
|
||||||
container_name: php-apache-dev
|
dockerfile: ./php/Dockerfile
|
||||||
ports:
|
container_name: web
|
||||||
- "${PUBLIC_PORT}:80"
|
ports:
|
||||||
volumes:
|
- "${PUBLIC_PORT}:80"
|
||||||
- ./src:/var/www/html
|
volumes:
|
||||||
- ./php/php.ini:/usr/local/etc/php/conf.d/99-custom.ini
|
- app_data:/var/www/html
|
||||||
environment:
|
- ./php/php.ini:/usr/local/etc/php/conf.d/99-custom.ini
|
||||||
- APACHE_DOCUMENT_ROOT=/var/www/html
|
environment:
|
||||||
depends_on:
|
- APACHE_DOCUMENT_ROOT=/var/www/html
|
||||||
- db
|
depends_on:
|
||||||
networks:
|
- db
|
||||||
- devnet
|
networks:
|
||||||
|
- devnet
|
||||||
db:
|
|
||||||
image: mariadb:11.3
|
db:
|
||||||
container_name: mariadb-dev
|
image: mariadb:11.3
|
||||||
restart: unless-stopped
|
container_name: mariadb
|
||||||
environment:
|
restart: unless-stopped
|
||||||
MYSQL_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
|
environment:
|
||||||
MYSQL_DATABASE: ${MARIADB_DATABASE}
|
MYSQL_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD}
|
||||||
MYSQL_USER: ${MARIADB_USER}
|
MYSQL_DATABASE: ${MARIADB_DATABASE}
|
||||||
MYSQL_PASSWORD: ${MARIADB_PASSWORD}
|
MYSQL_USER: ${MARIADB_USER}
|
||||||
TZ: ${MARIADB_TIME_ZONE}
|
MYSQL_PASSWORD: ${MARIADB_PASSWORD}
|
||||||
volumes:
|
TZ: ${MARIADB_TIME_ZONE}
|
||||||
- db_data:/var/lib/mysql
|
volumes:
|
||||||
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql
|
- db_data:/var/lib/mysql
|
||||||
- ./db/my.cnf:/etc/mysql/conf.d/my.cnf
|
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql
|
||||||
ports:
|
- ./db/my.cnf:/etc/mysql/mariadb.conf.d/99-custom.cnf
|
||||||
- "${PUBLIC_MARIADB_PORT}:3306"
|
ports:
|
||||||
networks:
|
- "${PUBLIC_MARIADB_PORT}:3306"
|
||||||
- devnet
|
networks:
|
||||||
|
- devnet
|
||||||
networks:
|
|
||||||
devnet:
|
networks:
|
||||||
driver: bridge
|
devnet:
|
||||||
|
driver: bridge
|
||||||
volumes:
|
|
||||||
db_data:
|
volumes:
|
||||||
|
db_data:
|
||||||
|
app_data:
|
||||||
|
|||||||
+57
-15
@@ -1,16 +1,58 @@
|
|||||||
FROM php:8.2-apache
|
# Load php-apache
|
||||||
|
FROM php:8.2-apache
|
||||||
|
|
||||||
|
# Set working directory
|
||||||
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
|
# Install packages(apt)
|
||||||
|
RUN apt-get update
|
||||||
|
RUN apt-get install -y libpng-dev
|
||||||
|
RUN apt-get install -y libjpeg62-turbo-dev
|
||||||
|
RUN apt-get install -y libfreetype6-dev
|
||||||
|
RUN apt-get install -y libonig-dev
|
||||||
|
RUN apt-get install -y libzip-dev
|
||||||
|
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 apt-get update
|
|
||||||
RUN apt-get install -y \
|
|
||||||
libpng-dev \
|
|
||||||
libjpeg62-turbo-dev \
|
|
||||||
libfreetype6-dev \
|
|
||||||
libonig-dev \
|
|
||||||
libzip-dev \
|
|
||||||
zip \
|
|
||||||
unzip
|
|
||||||
RUN docker-php-ext-configure gd --with-freetype --with-jpeg
|
|
||||||
RUN docker-php-ext-install gd pdo_mysql mysqli mbstring zip fileinfo
|
|
||||||
|
|
||||||
RUN a2enmod rewrite headers
|
|
||||||
COPY apache2.conf /etc/apache2/conf-enabled/99-custom.conf
|
|
||||||
|
|||||||
+9
-8
@@ -1,9 +1,10 @@
|
|||||||
<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>
|
||||||
|
|
||||||
|
ServerName localhost
|
||||||
|
ServerAdmin webmaster@localhost
|
||||||
|
DocumentRoot /var/www/html
|
||||||
|
|
||||||
ServerName localhost
|
|
||||||
ServerAdmin webmaster@localhost
|
|
||||||
DocumentRoot /var/www/html
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
+8
-7
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user