chore(docker): add vendor to .dockerignore, update Composer installation in Dockerfile, and clean up README instructions

This commit is contained in:
2026-06-06 23:26:21 +03:30
parent 3029f80d16
commit 12d149e5d9
3 changed files with 10 additions and 9 deletions

View File

@@ -9,6 +9,7 @@
!.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

@@ -2,11 +2,13 @@ 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
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y --no-install-recommends \ && apt-get install -y --no-install-recommends \
default-mysql-client \ default-mysql-client \
default-libmysqlclient-dev \ default-libmysqlclient-dev \
git \
libicu-dev \ libicu-dev \
libzip-dev \ libzip-dev \
unzip \ unzip \
@@ -25,9 +27,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 ./
COPY vendor ./vendor RUN composer install \
RUN test -f vendor/autoload.php || (echo "ERROR: vendor folder is missing. Run: composer install --no-dev" >&2 && exit 1) \ --no-dev \
&& composer dump-autoload --no-dev --optimize --no-scripts \ --no-autoloader \
--no-scripts \
--prefer-dist \
--no-interaction \
&& composer check-platform-reqs --no-dev && composer check-platform-reqs --no-dev
COPY . . COPY . .

View File

@@ -17,12 +17,6 @@ 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` است.
قبل از build، وابستگی‌های PHP را نصب کن:
```bash
composer install --no-dev --prefer-dist
```
برای build کردن imageها: برای build کردن imageها:
```bash ```bash
@@ -99,3 +93,4 @@ docker compose --env-file .env.production down -v
```bash ```bash
docker compose --env-file .env.production restart app queue scheduler docker compose --env-file .env.production restart app queue scheduler
``` ```