commit 7142078ef94a800317347d7d2c2f2a66ab64c4b9 Author: SaEEd Date: Tue Jan 10 08:53:54 2023 +0330 first commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..19ea3a6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,53 @@ +FROM git.alshafagh.ir/docker/php:8.2-cli-bullseye +RUN apt-get update; \ + apt-get upgrade -yqq; \ + pecl -q channel-update pecl.php.net; \ + apt-get install -yqq --no-install-recommends --show-progress \ + apt-utils \ + gnupg \ + gosu \ + git \ + curl \ + wget \ + libcurl4-openssl-dev \ + ca-certificates \ + supervisor \ + libmemcached-dev \ + libz-dev \ + libbrotli-dev \ + libpq-dev \ + libjpeg-dev \ + libpng-dev \ + libfreetype6-dev \ + libssl-dev \ + libwebp-dev \ + libmcrypt-dev \ + libonig-dev \ + libzip-dev zip unzip \ + libargon2-1 \ + libidn2-0 \ + libpcre2-8-0 \ + libpcre3 \ + libxml2 \ + libzstd1 \ + procps \ + zlib1g-dev \ + libicu-dev \ + g++ \ + libc-ares-dev \ + supervisor + +RUN docker-php-ext-configure zip +RUN docker-php-ext-configure intl +RUN docker-php-ext-configure gd --prefix=/usr --with-jpeg --with-webp --with-freetype +RUN docker-php-ext-install pdo_mysql exif pcntl bcmath gd intl zip mbstring sockets +RUN pecl install redis +RUN pecl install -D 'enable-sockets="yes" enable-openssl="yes" enable-http2="yes" enable-mysqlnd="yes" enable-hook-curl="yes" enable-cares="yes" with-postgres="yes"' openswoole +RUN docker-php-ext-enable redis openswoole +RUN groupadd --force -g 1000 octane && useradd -ms /bin/bash --no-log-init --no-user-group -g 1000 -u 1000 octane +WORKDIR /app +RUN chown -R octane:octane . +EXPOSE 80 +COPY ./supervisord.conf /etc/supervisord.conf +ENTRYPOINT ["supervisord", "--nodaemon", "--configuration", "/etc/supervisord.conf"] +HEALTHCHECK --start-period=5s --interval=2s --timeout=5s --retries=8 CMD php artisan octane:status || exit 1 diff --git a/build_and_push.sh b/build_and_push.sh new file mode 100755 index 0000000..895a6c8 --- /dev/null +++ b/build_and_push.sh @@ -0,0 +1,3 @@ +docker build -t laravel-octane-8.2 . +docker tag laravel-octane-8.2 git.alshafagh.ir/docker/laravel-octane:8.2 +docker push git.alshafagh.ir/docker/laravel-octane:8.2 diff --git a/supervisord.conf b/supervisord.conf new file mode 100644 index 0000000..f920158 --- /dev/null +++ b/supervisord.conf @@ -0,0 +1,17 @@ +[supervisord] +nodaemon=true +user=root +logfile=/var/log/supervisor/supervisord.log +pidfile=/var/run/supervisord.pid + +[program:octane] +process_name=%(program_name)s_%(process_num)02d +command=php /app/artisan octane:start --server=swoole --host=0.0.0.0 --port=80 --workers=auto --task-workers=auto --max-requests=500 +user=octane +autostart=true +autorestart=true +environment=LARAVEL_OCTANE="1" +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0