Add
This commit is contained in:
parent
8db61daaeb
commit
4156a37529
|
|
@ -27,9 +27,9 @@ services:
|
||||||
dockerfile: ./docker/php/Dockerfile
|
dockerfile: ./docker/php/Dockerfile
|
||||||
args:
|
args:
|
||||||
# اینجا میتوانید آدرس Nexus داخلی سرور خود را بدهید
|
# اینجا میتوانید آدرس Nexus داخلی سرور خود را بدهید
|
||||||
- COMPOSER_REGISTRY=http://192.168.1.201:8081/
|
- COMPOSER_REGISTRY=http://192.168.1.201:8081/repository/composer-runflare/
|
||||||
- LINUX_REGISTRY=http://192.168.1.201:8081/
|
- LINUX_REGISTRY=http://192.168.1.201:8081/repository/debian-arvan
|
||||||
- SECURITY_REGISTRY=http://192.168.1.201:8081/
|
- SECURITY_REGISTRY=http://192.168.1.201:8081/repository/debian-arvan-security
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/var/www/html:rw
|
- ./:/var/www/html:rw
|
||||||
networks:
|
networks:
|
||||||
|
|
|
||||||
|
|
@ -1,35 +1,39 @@
|
||||||
FROM php:8.2-fpm-bookworm
|
FROM php:8.2-fpm-bookworm
|
||||||
|
|
||||||
# متغیرهای ریجستری (قابل تنظیم از سمت docker-compose)
|
# متغیرهای ریجستری
|
||||||
ARG COMPOSER_REGISTRY="https://mirror-composer.runflare.com"
|
ARG COMPOSER_REGISTRY="https://mirror-composer.runflare.com"
|
||||||
ARG LINUX_REGISTRY="http://deb.debian.org/debian"
|
ARG LINUX_REGISTRY="http://deb.debian.org/debian"
|
||||||
ARG SECURITY_REGISTRY="http://security.debian.org/debian-security"
|
ARG SECURITY_REGISTRY="http://security.debian.org/debian-security"
|
||||||
|
|
||||||
# تغییر سورسهای apt به ریجستری لوکال/کاستوم شما
|
# تغییر سورسهای apt
|
||||||
RUN sed -i "s|http://deb.debian.org/debian|${LINUX_REGISTRY}|g" /etc/apt/sources.list.d/debian.sources \
|
RUN sed -i "s|http://deb.debian.org/debian|${LINUX_REGISTRY}|g" /etc/apt/sources.list.d/debian.sources \
|
||||||
&& sed -i "s|http://security.debian.org/debian-security|${SECURITY_REGISTRY}|g" /etc/apt/sources.list.d/debian.sources \
|
&& sed -i "s|http://security.debian.org/debian-security|${SECURITY_REGISTRY}|g" /etc/apt/sources.list.d/debian.sources \
|
||||||
&& echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99ignore \
|
&& echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf.d/99ignore \
|
||||||
&& echo 'Acquire::AllowInsecureRepositories "true";' >> /etc/apt/apt.conf.d/99ignore
|
&& echo 'Acquire::AllowInsecureRepositories "true";' >> /etc/apt/apt.conf.d/99ignore
|
||||||
|
|
||||||
# نصب وابستگیهای پایه (بدون دیتابیس چون فعلاً نیاز نداریم)
|
# نصب nodejs و npm در کنار سایر وابستگیها
|
||||||
RUN apt-get update && apt-get install -y --allow-downgrades --no-install-recommends \
|
RUN apt-get update && apt-get install -y --allow-downgrades --no-install-recommends \
|
||||||
libzip-dev \
|
libzip-dev \
|
||||||
unzip \
|
unzip \
|
||||||
git \
|
git \
|
||||||
curl \
|
curl \
|
||||||
|
nodejs \
|
||||||
|
npm \
|
||||||
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# نصب اکستنشنهای پایه PHP
|
|
||||||
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
|
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
|
||||||
RUN install-php-extensions zip bcmath
|
RUN install-php-extensions zip bcmath
|
||||||
|
|
||||||
# تنظیمات کامپوزر و استفاده از ریجستری
|
|
||||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
ENV COMPOSER_ALLOW_SUPERUSER=1
|
ENV COMPOSER_ALLOW_SUPERUSER=1
|
||||||
|
|
||||||
# غیرفعال کردن JIT برای جلوگیری از باگهای احتمالی PCRE
|
|
||||||
RUN echo "pcre.jit=0" > /usr/local/etc/php/conf.d/disable-pcre-jit.ini
|
RUN echo "pcre.jit=0" > /usr/local/etc/php/conf.d/disable-pcre-jit.ini
|
||||||
|
|
||||||
CMD ["php-fpm"]
|
# === [ بخش جدید: اضافه کردن Entrypoint ] ===
|
||||||
|
COPY ./docker/php/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||||
|
# دادن دسترسی اجرا به فایل
|
||||||
|
RUN chmod +x /usr/local/bin/entrypoint.sh
|
||||||
|
|
||||||
|
# واگذاری کنترل اجرای کانتینر به اسکریپت ما
|
||||||
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||||
18
docker/php/entrypoint.sh
Normal file
18
docker/php/entrypoint.sh
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# توقف اجرا در صورت بروز خطای بحرانی
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "[+] Starting Initialization Process..."
|
||||||
|
|
||||||
|
# بررسی و نصب پکیجهای NPM
|
||||||
|
echo "[+] Installing NPM dependencies..."
|
||||||
|
npm install
|
||||||
|
|
||||||
|
# کامپایل کردن فایلهای Tailwind و Alpine برای پروداکشن
|
||||||
|
echo "[+] Building frontend assets..."
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
# راهاندازی سرویس اصلی (PHP-FPM)
|
||||||
|
echo "[+] Starting PHP-FPM for Browser-Sec-Lab..."
|
||||||
|
exec php-fpm
|
||||||
Loading…
Reference in New Issue
Block a user