first commit

This commit is contained in:
Saufi
2026-06-24 20:32:14 +08:00
commit 10fb30ad69
201 changed files with 21356 additions and 0 deletions

86
Dockerfile Normal file
View File

@@ -0,0 +1,86 @@
# ─────────────────────────────────────────────────────────────
# Production image — PHP 8.4 FPM · Debian Bookworm
# Sistem Pemantauan Kemampanan Pusat Data MBIP
#
# Extensions sedia ada dalam php:8.4-fpm-bookworm — JANGAN pasang
# semula (mencetuskan recompile + header hilang):
# ctype · curl · dom · fileinfo · json · openssl · pcre
# posix · readline · session · simplexml · sodium
# tokenizer · xml · xmlreader · xmlwriter · zlib
# ─────────────────────────────────────────────────────────────
FROM php:8.4-fpm-bookworm
LABEL maintainer="MBIP"
LABEL description="Sistem Pemantauan Kemampanan Pusat Data MBIP — PHP 8.4 FPM"
ENV TZ=Asia/Kuala_Lumpur
# ── System libs + timezone ───────────────────────────────────
RUN apt-get update && apt-get install -y --no-install-recommends \
tzdata \
libpng-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
libwebp-dev \
libzip-dev \
libicu-dev \
libonig-dev \
default-mysql-client \
supervisor \
unzip \
curl \
&& ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime \
&& echo ${TZ} > /etc/timezone \
&& rm -rf /var/lib/apt/lists/*
# ── Configure GD ─────────────────────────────────────────────
RUN docker-php-ext-configure gd \
--with-freetype \
--with-jpeg \
--with-webp
# ── Install extensions ────────────────────────────────────────
RUN docker-php-ext-install -j$(nproc) \
bcmath \
exif \
gd \
intl \
mbstring \
mysqli \
opcache \
pcntl \
pdo_mysql \
zip
# ── Composer ──────────────────────────────────────────────────
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
# ── PHP + FPM config ─────────────────────────────────────────
COPY docker/php/php.ini $PHP_INI_DIR/conf.d/99-mbip.ini
COPY docker/php/www.conf /usr/local/etc/php-fpm.d/www.conf
# ── Supervisor ────────────────────────────────────────────────
COPY docker/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# ── Cipta direktori yang diperlukan ──────────────────────────
RUN mkdir -p \
/var/www/html/bootstrap/cache \
/var/www/html/storage/framework/cache/data \
/var/www/html/storage/framework/sessions \
/var/www/html/storage/framework/testing \
/var/www/html/storage/framework/views \
/var/www/html/storage/app/public \
/var/www/html/storage/app/private/reports \
/var/www/html/storage/logs \
/var/log/php-fpm \
/var/log/supervisor
# ── Entrypoint ────────────────────────────────────────────────
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
WORKDIR /var/www/html
EXPOSE 9000
ENTRYPOINT ["/entrypoint.sh"]