first commit

This commit is contained in:
2023-01-10 08:53:54 +03:30
commit 7142078ef9
3 changed files with 73 additions and 0 deletions

53
Dockerfile Normal file
View File

@@ -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

3
build_and_push.sh Executable file
View File

@@ -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

17
supervisord.conf Normal file
View File

@@ -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