feat: 그누보드5 R2 스토리지 확장 모듈 초기 설정
- Docker 개발 환경 구성 (nginx, php, mariadb) - 그누보드 기본 extend 파일들 추가 - R2 파일 목록 확인 스크립트 추가 - .gitignore 설정 (gnuboard 코어, 테스트 파일 제외) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
38
docker/Dockerfile.php
Normal file
38
docker/Dockerfile.php
Normal file
@@ -0,0 +1,38 @@
|
||||
FROM php:8.1-fpm-alpine
|
||||
|
||||
# 필수 패키지 설치
|
||||
RUN apk add --no-cache \
|
||||
freetype-dev \
|
||||
libjpeg-turbo-dev \
|
||||
libpng-dev \
|
||||
libwebp-dev \
|
||||
libzip-dev \
|
||||
icu-dev \
|
||||
oniguruma-dev \
|
||||
$PHPIZE_DEPS
|
||||
|
||||
# PHP 확장 설치
|
||||
RUN docker-php-ext-configure gd \
|
||||
--with-freetype \
|
||||
--with-jpeg \
|
||||
--with-webp \
|
||||
&& docker-php-ext-install -j$(nproc) \
|
||||
gd \
|
||||
mysqli \
|
||||
pdo_mysql \
|
||||
zip \
|
||||
intl \
|
||||
mbstring \
|
||||
fileinfo \
|
||||
opcache
|
||||
|
||||
# Composer 설치
|
||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||
|
||||
# PHP 설정
|
||||
RUN echo "upload_max_filesize = 50M" > /usr/local/etc/php/conf.d/uploads.ini \
|
||||
&& echo "post_max_size = 50M" >> /usr/local/etc/php/conf.d/uploads.ini \
|
||||
&& echo "memory_limit = 256M" >> /usr/local/etc/php/conf.d/uploads.ini \
|
||||
&& echo "max_execution_time = 300" >> /usr/local/etc/php/conf.d/uploads.ini
|
||||
|
||||
WORKDIR /var/www/html
|
||||
41
docker/nginx.conf
Normal file
41
docker/nginx.conf
Normal file
@@ -0,0 +1,41 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
root /var/www/html;
|
||||
index index.php index.html;
|
||||
|
||||
charset utf-8;
|
||||
|
||||
# 그누보드 rewrite 규칙
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
# PHP 처리
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass php:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
fastcgi_read_timeout 300;
|
||||
}
|
||||
|
||||
# 정적 파일 캐싱
|
||||
location ~* \.(jpg|jpeg|png|gif|ico|css|js|woff|woff2)$ {
|
||||
expires 30d;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
|
||||
# 보안: 숨김 파일 차단
|
||||
location ~ /\. {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# 보안: data 폴더 PHP 실행 차단
|
||||
location ~* ^/data/.*\.php$ {
|
||||
deny all;
|
||||
}
|
||||
|
||||
# 업로드 크기 제한
|
||||
client_max_body_size 50M;
|
||||
}
|
||||
Reference in New Issue
Block a user