This commit is contained in:
mcoder 2026-04-14 14:13:15 +03:30
parent 4156a37529
commit 04afc3c5ba
2 changed files with 7 additions and 4 deletions

View File

@ -30,6 +30,7 @@ services:
- COMPOSER_REGISTRY=http://192.168.1.201:8081/repository/composer-runflare/ - COMPOSER_REGISTRY=http://192.168.1.201:8081/repository/composer-runflare/
- LINUX_REGISTRY=http://192.168.1.201:8081/repository/debian-arvan - LINUX_REGISTRY=http://192.168.1.201:8081/repository/debian-arvan
- SECURITY_REGISTRY=http://192.168.1.201:8081/repository/debian-arvan-security - SECURITY_REGISTRY=http://192.168.1.201:8081/repository/debian-arvan-security
- NPM_REGISTRY=http://192.168.1.201:8081/repository/npm-group/
volumes: volumes:
- ./:/var/www/html:rw - ./:/var/www/html:rw
networks: networks:

View File

@ -1,9 +1,10 @@
FROM php:8.2-fpm-bookworm FROM php:8.2-fpm-bookworm
# متغیرهای ریجستری # متغیرهای ریجستری (اضافه شدن NPM)
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"
ARG NPM_REGISTRY="https://registry.npmjs.org"
# تغییر سورس‌های 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 \
@ -21,6 +22,9 @@ RUN apt-get update && apt-get install -y --allow-downgrades --no-install-recomme
npm \ npm \
&& apt-get clean && rm -rf /var/lib/apt/lists/* && apt-get clean && rm -rf /var/lib/apt/lists/*
# === [ تنظیم ریجستری اختصاصی NPM ] ===
RUN npm config set registry ${NPM_REGISTRY}
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
@ -30,10 +34,8 @@ ENV COMPOSER_ALLOW_SUPERUSER=1
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
# === [ بخش جدید: اضافه کردن Entrypoint ] === # اضافه کردن Entrypoint
COPY ./docker/php/entrypoint.sh /usr/local/bin/entrypoint.sh COPY ./docker/php/entrypoint.sh /usr/local/bin/entrypoint.sh
# دادن دسترسی اجرا به فایل
RUN chmod +x /usr/local/bin/entrypoint.sh RUN chmod +x /usr/local/bin/entrypoint.sh
# واگذاری کنترل اجرای کانتینر به اسکریپت ما
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]