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
node_modules
vendor
npm-debug.log
yarn-error.log

View File

@@ -2,11 +2,13 @@ FROM php:8.4-fpm-bookworm AS app
WORKDIR /var/www/html
ENV COMPOSER_ALLOW_SUPERUSER=1
ENV COMPOSER_PROCESS_TIMEOUT=600
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
default-mysql-client \
default-libmysqlclient-dev \
git \
libicu-dev \
libzip-dev \
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 composer.json composer.lock ./
COPY vendor ./vendor
RUN test -f vendor/autoload.php || (echo "ERROR: vendor folder is missing. Run: composer install --no-dev" >&2 && exit 1) \
&& composer dump-autoload --no-dev --optimize --no-scripts \
RUN composer install \
--no-dev \
--no-autoloader \
--no-scripts \
--prefer-dist \
--no-interaction \
&& composer check-platform-reqs --no-dev
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` است.
قبل از build، وابستگی‌های PHP را نصب کن:
```bash
composer install --no-dev --prefer-dist
```
برای build کردن imageها:
```bash
@@ -99,3 +93,4 @@ docker compose --env-file .env.production down -v
```bash
docker compose --env-file .env.production restart app queue scheduler
```