chore(docker): remove Composer process timeout and git installation, update README for vendor folder setup
This commit is contained in:
@@ -9,7 +9,6 @@
|
||||
!.env.production.example
|
||||
|
||||
node_modules
|
||||
vendor
|
||||
npm-debug.log
|
||||
yarn-error.log
|
||||
|
||||
|
||||
29
Dockerfile
29
Dockerfile
@@ -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
|
||||
|
||||
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 -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 \
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
default-mysql-client \
|
||||
default-libmysqlclient-dev \
|
||||
git \
|
||||
libicu-dev \
|
||||
libzip-dev \
|
||||
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 composer.json composer.lock ./
|
||||
RUN composer config repos.packagist composer https://mirror-composer.runflare.com \
|
||||
&& composer config --global process-timeout 600 \
|
||||
&& composer install \
|
||||
--no-dev \
|
||||
--no-autoloader \
|
||||
--no-scripts \
|
||||
--prefer-dist \
|
||||
--no-interaction \
|
||||
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 \
|
||||
&& composer check-platform-reqs --no-dev
|
||||
|
||||
COPY . .
|
||||
# COPY --from=assets /app/public/build ./public/build
|
||||
|
||||
RUN composer dump-autoload --no-dev --optimize --no-scripts \
|
||||
&& php artisan package:discover --ansi \
|
||||
@@ -68,9 +55,7 @@ EXPOSE 9000
|
||||
ENTRYPOINT ["docker-entrypoint"]
|
||||
CMD ["php-fpm"]
|
||||
|
||||
FROM docker.arvancloud.ir/nginx:1.27-alpine AS nginx
|
||||
|
||||
RUN sed -i 's|https://dl-cdn.alpinelinux.org|https://mirror.arvancloud.ir/alpine|g' /etc/apk/repositories
|
||||
FROM nginx:1.27-alpine AS nginx
|
||||
|
||||
COPY docker/nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=app /var/www/html/public /var/www/html/public
|
||||
|
||||
@@ -17,11 +17,10 @@ APP_KEY=base64:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
|
||||
|
||||
سپس `APP_URL`، `HTTP_PORT`، `DB_PASSWORD`، `MARIADB_PASSWORD` و `MARIADB_ROOT_PASSWORD` را هم تغییر دهید. مقدار پیشفرض `HTTP_PORT=8080` است.
|
||||
|
||||
روی سرور ایران، میرور Docker را یکبار تنظیم کنید:
|
||||
قبل از build، وابستگیهای PHP را نصب کن:
|
||||
|
||||
```bash
|
||||
sudo cp docker/daemon.json /etc/docker/daemon.json
|
||||
sudo systemctl restart docker
|
||||
composer install --no-dev --prefer-dist
|
||||
```
|
||||
|
||||
برای build کردن imageها:
|
||||
|
||||
@@ -77,7 +77,7 @@ services:
|
||||
- hoshpoint
|
||||
|
||||
mariadb:
|
||||
image: docker.arvancloud.ir/mariadb:11.4
|
||||
image: mariadb:11.4
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- ${APP_ENV_FILE:-.env.production}
|
||||
|
||||
@@ -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
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"registry-mirrors": ["https://docker.arvancloud.ir"]
|
||||
}
|
||||
Reference in New Issue
Block a user