chore(docker): remove Composer process timeout and git installation, update README for vendor folder setup

This commit is contained in:
2026-06-06 23:15:18 +03:30
parent 97fc7855ca
commit 3029f80d16
6 changed files with 10 additions and 35 deletions

View File

@@ -9,7 +9,6 @@
!.env.production.example !.env.production.example
node_modules node_modules
vendor
npm-debug.log npm-debug.log
yarn-error.log yarn-error.log

View File

@@ -1,19 +1,12 @@
FROM docker.arvancloud.ir/php:8.4-fpm-bookworm AS app FROM php:8.4-fpm-bookworm AS app
WORKDIR /var/www/html WORKDIR /var/www/html
ENV COMPOSER_ALLOW_SUPERUSER=1 ENV COMPOSER_ALLOW_SUPERUSER=1
ENV COMPOSER_PROCESS_TIMEOUT=600
COPY docker/apt/debian.sources /etc/apt/sources.list.d/debian.sources RUN apt-get update \
&& apt-get install -y --no-install-recommends \
RUN apt-get -o Acquire::Check-Valid-Until=false update \
&& apt-get install -y --allow-downgrades --no-install-recommends \
libssl3=3.0.18-1~deb12u1 \
openssl=3.0.18-1~deb12u1 \
libssl-dev=3.0.18-1~deb12u1 \
default-mysql-client \ default-mysql-client \
default-libmysqlclient-dev \ default-libmysqlclient-dev \
git \
libicu-dev \ libicu-dev \
libzip-dev \ libzip-dev \
unzip \ unzip \
@@ -32,18 +25,12 @@ COPY docker/php/php.ini /usr/local/etc/php/conf.d/99-production.ini
COPY docker/php/opcache.ini /usr/local/etc/php/conf.d/99-opcache.ini COPY docker/php/opcache.ini /usr/local/etc/php/conf.d/99-opcache.ini
COPY composer.json composer.lock ./ COPY composer.json composer.lock ./
RUN composer config repos.packagist composer https://mirror-composer.runflare.com \ COPY vendor ./vendor
&& composer config --global process-timeout 600 \ RUN test -f vendor/autoload.php || (echo "ERROR: vendor folder is missing. Run: composer install --no-dev" >&2 && exit 1) \
&& composer install \ && composer dump-autoload --no-dev --optimize --no-scripts \
--no-dev \
--no-autoloader \
--no-scripts \
--prefer-dist \
--no-interaction \
&& composer check-platform-reqs --no-dev && composer check-platform-reqs --no-dev
COPY . . COPY . .
# COPY --from=assets /app/public/build ./public/build
RUN composer dump-autoload --no-dev --optimize --no-scripts \ RUN composer dump-autoload --no-dev --optimize --no-scripts \
&& php artisan package:discover --ansi \ && php artisan package:discover --ansi \
@@ -68,9 +55,7 @@ EXPOSE 9000
ENTRYPOINT ["docker-entrypoint"] ENTRYPOINT ["docker-entrypoint"]
CMD ["php-fpm"] CMD ["php-fpm"]
FROM docker.arvancloud.ir/nginx:1.27-alpine AS nginx FROM nginx:1.27-alpine AS nginx
RUN sed -i 's|https://dl-cdn.alpinelinux.org|https://mirror.arvancloud.ir/alpine|g' /etc/apk/repositories
COPY docker/nginx/default.conf /etc/nginx/conf.d/default.conf COPY docker/nginx/default.conf /etc/nginx/conf.d/default.conf
COPY --from=app /var/www/html/public /var/www/html/public COPY --from=app /var/www/html/public /var/www/html/public

View File

@@ -17,11 +17,10 @@ APP_KEY=base64:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
سپس `APP_URL`، `HTTP_PORT`، `DB_PASSWORD`، `MARIADB_PASSWORD` و `MARIADB_ROOT_PASSWORD` را هم تغییر دهید. مقدار پیش‌فرض `HTTP_PORT=8080` است. سپس `APP_URL`، `HTTP_PORT`، `DB_PASSWORD`، `MARIADB_PASSWORD` و `MARIADB_ROOT_PASSWORD` را هم تغییر دهید. مقدار پیش‌فرض `HTTP_PORT=8080` است.
روی سرور ایران، میرور Docker را یک‌بار تنظیم کنید: قبل از build، وابستگی‌های PHP را نصب کن:
```bash ```bash
sudo cp docker/daemon.json /etc/docker/daemon.json composer install --no-dev --prefer-dist
sudo systemctl restart docker
``` ```
برای build کردن imageها: برای build کردن imageها:

View File

@@ -77,7 +77,7 @@ services:
- hoshpoint - hoshpoint
mariadb: mariadb:
image: docker.arvancloud.ir/mariadb:11.4 image: mariadb:11.4
restart: unless-stopped restart: unless-stopped
env_file: env_file:
- ${APP_ENV_FILE:-.env.production} - ${APP_ENV_FILE:-.env.production}

View File

@@ -1,5 +0,0 @@
Types: deb
URIs: http://mirror.arvancloud.ir/debian
Suites: bookworm
Components: main
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

View File

@@ -1,3 +0,0 @@
{
"registry-mirrors": ["https://docker.arvancloud.ir"]
}