mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Docker Isolated new
This commit is contained in:
parent
84dce14077
commit
a6f6810dd1
25
Dockerfile
25
Dockerfile
@ -1,25 +0,0 @@
|
||||
FROM php:7.4-fpm as php
|
||||
|
||||
RUN usermod -u 1000 www-data
|
||||
|
||||
RUN apt-get update -y
|
||||
RUN apt-get install -y unzip libpq-dev libcurl4-gnutls-dev
|
||||
RUN docker-php-ext-install pdo pdo_mysql bcmath
|
||||
|
||||
WORKDIR /var/www
|
||||
|
||||
COPY --chown=www-data:www-data --chmod=777 . .
|
||||
|
||||
#COPY ./docker/php/php.ini /usr/local/etc/php/php.ini
|
||||
|
||||
#COPY ./docker/php/php.ini /usr/local/etc/php/php.ini
|
||||
#COPY ./docker/php/php-fpm.conf /usr/local/etc/php-fpm.d/www.conf
|
||||
#COPY ./docker/nginx/site.conf /etc/nginx/default.conf
|
||||
|
||||
COPY ./docker/nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||
|
||||
ENTRYPOINT [ "docker/entrypoint.sh" ]
|
||||
|
||||
#CMD ["docker/entrypoint.sh","php-fpm","-F"]
|
||||
@ -1,60 +1,86 @@
|
||||
version: '3.8'
|
||||
volumes:
|
||||
db-store:
|
||||
psysh-store:
|
||||
|
||||
networks:
|
||||
webapp:
|
||||
driver: bridge
|
||||
configs:
|
||||
db-config:
|
||||
file: ./docker/mysql/my.cnf
|
||||
|
||||
services:
|
||||
nginx:
|
||||
image: nginx:stable-alpine
|
||||
container_name: ${APP_NAME}_nginx
|
||||
ports:
|
||||
- "8000:80"
|
||||
volumes:
|
||||
- ./:/var/www
|
||||
# - ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:rw
|
||||
- ./docker/logs/nginx:/var/logs/nginx:rw
|
||||
depends_on:
|
||||
- php
|
||||
- database
|
||||
networks:
|
||||
- webapp
|
||||
php:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
dockerfile: ./docker/php/Dockerfile
|
||||
target: ${APP_BUILD_TARGET:-development}
|
||||
container_name: oc_php
|
||||
environment:
|
||||
- CONTAINER_ROLE=app
|
||||
volumes:
|
||||
- ./:/var/www
|
||||
ports:
|
||||
- "9001:9000"
|
||||
networks:
|
||||
- webapp
|
||||
- type: bind
|
||||
source: ./
|
||||
target: /workspace
|
||||
- type: volume
|
||||
source: psysh-store
|
||||
target: /root/.config/psysh
|
||||
volume:
|
||||
nocopy: true
|
||||
environment:
|
||||
- APP_DEBUG=${APP_DEBUG:-true}
|
||||
- APP_ENV=${APP_ENV:-local}
|
||||
- APP_URL=${APP_URL:-http://localhost}
|
||||
- LOG_CHANNEL=${LOG_CHANNEL:-stderr}
|
||||
- LOG_STDERR_FORMATTER=${LOG_STDERR_FORMATTER:-Monolog\Formatter\JsonFormatter}
|
||||
- DB_CONNECTION=${DB_CONNECTION:-mysql}
|
||||
- DB_HOST=${DB_HOST:-db}
|
||||
- DB_PORT=${DB_PORT:-3306}
|
||||
- DB_DATABASE=${DB_DATABASE:-laravel}
|
||||
- DB_USERNAME=${DB_USERNAME:-phper}
|
||||
- DB_PASSWORD=${DB_PASSWORD:-secret}
|
||||
depends_on:
|
||||
database:
|
||||
condition: service_healthy
|
||||
|
||||
# Database Server
|
||||
database:
|
||||
image: mysql:8.0
|
||||
container_name: ${APP_NAME}_database
|
||||
nginx:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./docker/nginx/Dockerfile
|
||||
container_name: ${APP_NAME}_nginx
|
||||
ports:
|
||||
- "3306:3306"
|
||||
command: --max_allowed_packet=32505856 # Set max_allowed_packet to 256M (or any other value)
|
||||
environment:
|
||||
- MYSQL_DATABASE=oc
|
||||
- MYSQL_USER=oc
|
||||
- MYSQL_PASSWORD=oc
|
||||
- MYSQL_ROOT_PASSWORD=oc
|
||||
- DB_HOST=host.docker.internal
|
||||
- target: 80
|
||||
published: ${WEB_PUBLISHED_PORT:-80}
|
||||
protocol: tcp
|
||||
mode: host
|
||||
volumes:
|
||||
- db-data:/var/lib/mysql:delegated
|
||||
- type: bind
|
||||
source: ./
|
||||
target: /workspace
|
||||
depends_on:
|
||||
- php
|
||||
- database
|
||||
|
||||
database:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./docker/mysql/Dockerfile
|
||||
command: --max_allowed_packet=32505856 # Set max_allowed_packet to 256M (or any other value)
|
||||
ports:
|
||||
- target: 3306
|
||||
published: ${DB_PUBLISHED_PORT:-3306}
|
||||
protocol: tcp
|
||||
mode: host
|
||||
configs:
|
||||
- source: db-config
|
||||
target: /etc/my.cnf
|
||||
volumes:
|
||||
- type: volume
|
||||
source: db-store
|
||||
target: /var/lib/mysql
|
||||
volume:
|
||||
nocopy: true
|
||||
environment:
|
||||
- MYSQL_DATABASE=${DB_DATABASE:-laravel}
|
||||
- MYSQL_USER=${DB_USERNAME:-phper}
|
||||
- MYSQL_PASSWORD=${DB_PASSWORD:-secret}
|
||||
- MYSQL_ROOT_PASSWORD=${DB_PASSWORD:-secret}
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
volumes:
|
||||
db-data: ~
|
||||
|
||||
@ -1,2 +0,0 @@
|
||||
WWWGROUP=1000
|
||||
WWWUSER=1000
|
||||
@ -1,68 +0,0 @@
|
||||
FROM ubuntu:20.04
|
||||
|
||||
LABEL maintainer="Taylor Otwell"
|
||||
|
||||
ARG WWWGROUP
|
||||
ARG NODE_VERSION=16
|
||||
ARG POSTGRES_VERSION=14
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV TZ=UTC
|
||||
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 \
|
||||
&& mkdir -p ~/.gnupg \
|
||||
&& chmod 600 ~/.gnupg \
|
||||
&& echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf \
|
||||
&& echo "keyserver hkp://keyserver.ubuntu.com:80" >> ~/.gnupg/dirmngr.conf \
|
||||
&& gpg --recv-key 0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c \
|
||||
&& gpg --export 0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c > /usr/share/keyrings/ppa_ondrej_php.gpg \
|
||||
&& echo "deb [signed-by=/usr/share/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y php7.4-cli php7.4-dev \
|
||||
php7.4-pgsql php7.4-sqlite3 php7.4-gd \
|
||||
php7.4-curl php7.4-memcached \
|
||||
php7.4-imap php7.4-mysql php7.4-mbstring \
|
||||
php7.4-xml php7.4-zip php7.4-bcmath php7.4-soap \
|
||||
php7.4-intl php7.4-readline php7.4-pcov \
|
||||
php7.4-msgpack php7.4-igbinary php7.4-ldap \
|
||||
php7.4-redis php7.4-xdebug \
|
||||
&& php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer \
|
||||
&& curl -sLS https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \
|
||||
&& apt-get install -y nodejs \
|
||||
&& npm install -g npm \
|
||||
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarnkey.gpg >/dev/null \
|
||||
&& echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list \
|
||||
&& curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /usr/share/keyrings/pgdg.gpg >/dev/null \
|
||||
&& echo "deb [signed-by=/usr/share/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt focal-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y yarn \
|
||||
&& apt-get install -y mysql-client \
|
||||
&& apt-get install -y postgresql-client-$POSTGRES_VERSION \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y cron \
|
||||
&& apt-get -y autoremove \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
RUN setcap "cap_net_bind_service=+ep" /usr/bin/php7.4
|
||||
|
||||
RUN groupadd --force -g $WWWGROUP sail
|
||||
RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail
|
||||
|
||||
COPY start-container /usr/local/bin/start-container
|
||||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
COPY php.ini /etc/php/7.4/cli/conf.d/99-sail.ini
|
||||
RUN chmod +x /usr/local/bin/start-container
|
||||
|
||||
COPY scheduler /etc/cron.d/scheduler
|
||||
RUN chmod 0644 /etc/cron.d/scheduler
|
||||
RUN crontab /etc/cron.d/scheduler
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
ENTRYPOINT ["start-container"]
|
||||
@ -1,4 +0,0 @@
|
||||
[PHP]
|
||||
post_max_size = 100M
|
||||
upload_max_filesize = 100M
|
||||
variables_order = EGPCS
|
||||
@ -1 +0,0 @@
|
||||
* * * * * root cd /var/www/html && php artisan schedule:run >> /dev/null 2>&1
|
||||
@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [ ! -z "$WWWUSER" ]; then
|
||||
usermod -u $WWWUSER sail
|
||||
fi
|
||||
|
||||
if [ ! -d /.composer ]; then
|
||||
mkdir /.composer
|
||||
fi
|
||||
|
||||
chmod -R ugo+rw /.composer
|
||||
|
||||
if [ $# -gt 0 ]; then
|
||||
exec gosu $WWWUSER "$@"
|
||||
else
|
||||
exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
|
||||
fi
|
||||
@ -1,17 +0,0 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
user=root
|
||||
logfile=/var/log/supervisor/supervisord.log
|
||||
pidfile=/var/run/supervisord.pid
|
||||
|
||||
[program:php]
|
||||
command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80
|
||||
user=sail
|
||||
environment=LARAVEL_SAIL="1"
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
|
||||
[include]
|
||||
files=/var/www/html/supervisord/*.conf
|
||||
@ -1,31 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "$APP_ENV"
|
||||
|
||||
if [ ! -f "vendor/autoload.php" ]; then
|
||||
composer install --no-progress --no-interaction
|
||||
else
|
||||
echo "composer. nothing to do."
|
||||
fi
|
||||
|
||||
if [ ! -f ".env" ]; then
|
||||
echo "Creating env file for env $APP_ENV from env-sail"
|
||||
cp .env-sail .env
|
||||
else
|
||||
echo "env file exists. nothing to do."
|
||||
fi
|
||||
|
||||
# TODO make role based @fatihalp
|
||||
role=${CONTAINER_ROLE:-app}
|
||||
|
||||
if [ "$role" = "app" ]; then
|
||||
echo ".env installed is false starting installing"
|
||||
php artisan install --ready
|
||||
exec docker-php-entrypoint "$@"
|
||||
elif [ "$role" = "queue" ]; then
|
||||
echo "Running the queue ... "
|
||||
php /var/www/artisan queue:work --verbose --tries=3 --timeout=180
|
||||
elif [ "$role" = "websocket" ]; then
|
||||
echo "Running the websocket server ... "
|
||||
php artisan websockets:serve
|
||||
fi
|
||||
7
docker/mysql/Dockerfile
Normal file
7
docker/mysql/Dockerfile
Normal file
@ -0,0 +1,7 @@
|
||||
FROM mysql/mysql-server:8.0
|
||||
|
||||
ENV TZ=UTC
|
||||
|
||||
RUN mkdir /var/log/mysql \
|
||||
&& chown mysql:mysql $_ \
|
||||
&& chmod 777 $_
|
||||
37
docker/mysql/my.cnf
Normal file
37
docker/mysql/my.cnf
Normal file
@ -0,0 +1,37 @@
|
||||
[mysqld]
|
||||
# default
|
||||
skip-host-cache
|
||||
skip-name-resolve
|
||||
datadir = /var/lib/mysql
|
||||
socket = /var/lib/mysql/mysql.sock
|
||||
secure-file-priv = /var/lib/mysql-files
|
||||
user = mysql
|
||||
|
||||
pid-file = /var/run/mysqld/mysqld.pid
|
||||
|
||||
# character set / collation
|
||||
character_set_server = utf8mb4
|
||||
collation_server = utf8mb4_0900_ai_ci
|
||||
|
||||
# timezone
|
||||
default-time-zone = SYSTEM
|
||||
log_timestamps = SYSTEM
|
||||
|
||||
# Error Log
|
||||
log-error = /var/log/mysql/mysql-error.log
|
||||
|
||||
# Slow Query Log
|
||||
slow_query_log = 1
|
||||
slow_query_log_file = /var/log/mysql/mysql-slow.log
|
||||
long_query_time = 1.0
|
||||
log_queries_not_using_indexes = 0
|
||||
|
||||
# General Log
|
||||
general_log = 1
|
||||
general_log_file = /var/log/mysql/mysql-general.log
|
||||
|
||||
[mysql]
|
||||
default-character-set = utf8mb4
|
||||
|
||||
[client]
|
||||
default-character-set = utf8mb4
|
||||
9
docker/nginx/Dockerfile
Normal file
9
docker/nginx/Dockerfile
Normal file
@ -0,0 +1,9 @@
|
||||
FROM nginx:1.25
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
ENV TZ=UTC
|
||||
|
||||
COPY ./docker/nginx/*.conf /etc/nginx/conf.d/
|
||||
|
||||
|
||||
35
docker/nginx/default.conf
Normal file
35
docker/nginx/default.conf
Normal file
@ -0,0 +1,35 @@
|
||||
access_log /dev/stdout main;
|
||||
error_log /dev/stderr warn;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
root /workspace/public;
|
||||
|
||||
add_header X-Frame-Options "SAMEORIGIN";
|
||||
add_header X-XSS-Protection "1; mode=block";
|
||||
add_header X-Content-Type-Options "nosniff";
|
||||
|
||||
index index.php;
|
||||
|
||||
charset utf-8;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
location = /favicon.ico { access_log off; log_not_found off; }
|
||||
location = /robots.txt { access_log off; log_not_found off; }
|
||||
|
||||
error_page 404 /index.php;
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass php:9000;
|
||||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
location ~ /\.(?!well-known).* {
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
@ -1,45 +0,0 @@
|
||||
user www-data;
|
||||
|
||||
events {
|
||||
worker_connections 2048;
|
||||
}
|
||||
|
||||
http {
|
||||
keepalive_timeout 500;
|
||||
keepalive_requests 5000;
|
||||
|
||||
client_max_body_size 32m;
|
||||
client_body_buffer_size 32m;
|
||||
|
||||
sendfile on;
|
||||
server_tokens off;
|
||||
|
||||
upstream php-fpm {
|
||||
server 127.0.0.1:9000 max_fails=5 fail_timeout=5s;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 8000;
|
||||
server_name example.com;
|
||||
|
||||
root /var/www/public;
|
||||
index index.php;
|
||||
|
||||
error_log /var/log/nginx/error.log;
|
||||
access_log /var/log/nginx/access.log;
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass php-fpm;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
}
|
||||
}
|
||||
60
docker/php/Dockerfile
Normal file
60
docker/php/Dockerfile
Normal file
@ -0,0 +1,60 @@
|
||||
FROM php:8.2-fpm-bullseye AS base
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
# timezone environment
|
||||
ENV TZ=UTC \
|
||||
# locale
|
||||
LANG=en_US.UTF-8 \
|
||||
LANGUAGE=en_US:en \
|
||||
LC_ALL=en_US.UTF-8 \
|
||||
# composer environment
|
||||
COMPOSER_ALLOW_SUPERUSER=1 \
|
||||
COMPOSER_HOME=/composer
|
||||
|
||||
COPY --from=composer:2.5 /usr/bin/composer /usr/bin/composer
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install --no-install-recommends \
|
||||
locales \
|
||||
git \
|
||||
unzip \
|
||||
libzip-dev \
|
||||
libicu-dev \
|
||||
libonig-dev \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& locale-gen en_US.UTF-8 \
|
||||
&& localedef -f UTF-8 -i en_US en_US.UTF-8 \
|
||||
&& docker-php-ext-install \
|
||||
intl \
|
||||
pdo_mysql \
|
||||
zip \
|
||||
bcmath \
|
||||
&& composer config -g process-timeout 3600 \
|
||||
&& composer config -g repos.packagist composer https://packagist.org
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["docker/php/entrypoint.sh"]
|
||||
|
||||
FROM base AS development
|
||||
|
||||
COPY ./docker/php/php.development.ini /usr/local/etc/php/php.ini
|
||||
|
||||
FROM development AS development-xdebug
|
||||
|
||||
RUN pecl install xdebug && \
|
||||
docker-php-ext-enable xdebug
|
||||
|
||||
COPY ./docker/php/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
|
||||
|
||||
FROM base AS deploy
|
||||
|
||||
COPY ./docker/php/php.deploy.ini /usr/local/etc/php/php.ini
|
||||
COPY ./ /workspace
|
||||
|
||||
RUN composer install -q -n --no-ansi --no-dev --no-scripts --no-progress --prefer-dist \
|
||||
&& chmod -R 777 storage bootstrap/cache \
|
||||
&& php artisan optimize:clear \
|
||||
&& php artisan optimize
|
||||
31
docker/php/entrypoint.sh
Executable file
31
docker/php/entrypoint.sh
Executable file
@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ ! -f "vendor/autoload.php" ]; then
|
||||
composer install --no-progress --no-interaction
|
||||
else
|
||||
echo "composer. nothing to do."
|
||||
fi
|
||||
|
||||
if [ ! -f ".env" ]; then
|
||||
echo "Creating env file for env from env-sail"
|
||||
cp .env-sail .env
|
||||
else
|
||||
echo "env file exists. nothing to do."
|
||||
fi
|
||||
|
||||
# .env dosyasını oku ve değişkenleri tanımla
|
||||
while IFS= read -r line || [[ -n "$line" ]]; do
|
||||
if [[ "$line" == "INSTALLED="* ]]; then
|
||||
installed="${line#*=}"
|
||||
installed=$(echo "$installed" | tr -d '[:space:]' | tr -d '[:punct:]') # Boşlukları ve özel karakterleri sil
|
||||
break
|
||||
fi
|
||||
done < .env
|
||||
|
||||
# installed değişkenini kontrol et
|
||||
if [ "$installed" = "false" ]; then
|
||||
echo ".env installed is false starting installing"
|
||||
php artisan install --ready
|
||||
fi
|
||||
|
||||
php-fpm -R
|
||||
@ -1,279 +0,0 @@
|
||||
[www]
|
||||
; Log level
|
||||
; Possible Values: alert, error, warning, notice, debug
|
||||
; Default Value: notice
|
||||
;log_level = notice
|
||||
|
||||
; If this number of child processes exit with SIGSEGV or SIGBUS within the time
|
||||
; interval set by emergency_restart_interval then FPM will restart. A value
|
||||
; of '0' means 'Off'.
|
||||
; Default Value: 0
|
||||
;emergency_restart_threshold = 0
|
||||
|
||||
; Interval of time used by emergency_restart_interval to determine when
|
||||
; a graceful restart will be initiated. This can be useful to work around
|
||||
; accidental corruptions in an accelerator's shared memory.
|
||||
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
|
||||
; Default Unit: seconds
|
||||
; Default Value: 0
|
||||
;emergency_restart_interval = 0
|
||||
|
||||
; Time limit for child processes to wait for a reaction on signals from master.
|
||||
; Available units: s(econds), m(inutes), h(ours), or d(ays)
|
||||
; Default Unit: seconds
|
||||
; Default Value: 0
|
||||
;process_control_timeout = 0
|
||||
|
||||
; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
|
||||
; Default Value: yes
|
||||
;daemonize = yes
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;
|
||||
; Pool Definitions ;
|
||||
;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
; Multiple pools of child processes may be started with different listening
|
||||
; ports and different management options. The name of the pool will be
|
||||
; used in logs and stats. There is no limitation on the number of pools which
|
||||
; FPM can handle. Your system will tell you anyway :)
|
||||
|
||||
; Start a new pool named 'www'.
|
||||
; the variable $pool can we used in any directive and will be replaced by the
|
||||
; pool name ('www' here)
|
||||
[www]
|
||||
|
||||
; Per pool prefix
|
||||
; It only applies on the following directives:
|
||||
; - 'slowlog'
|
||||
; - 'listen' (unixsocket)
|
||||
; - 'chroot'
|
||||
; - 'chdir'
|
||||
; - 'php_values'
|
||||
; - 'php_admin_values'
|
||||
; When not set, the global prefix (or /etc) applies instead.
|
||||
; Note: This directive can also be relative to the global prefix.
|
||||
; Default Value: none
|
||||
;prefix = /path/to/pools/$pool
|
||||
|
||||
; The address on which to accept FastCGI requests.
|
||||
; Valid syntaxes are:
|
||||
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
|
||||
; a specific port;
|
||||
; 'port' - to listen on a TCP socket to all addresses on a
|
||||
; specific port;
|
||||
; '/path/to/unix/socket' - to listen on a unix socket.
|
||||
; Note: This value is mandatory.
|
||||
listen = 127.0.0.1:8000
|
||||
|
||||
; Set listen(2) backlog. A value of '-1' means unlimited.
|
||||
; Default Value: 128 (-1 on FreeBSD and OpenBSD)
|
||||
;listen.backlog = -1
|
||||
|
||||
; List of ipv4 addresses of FastCGI clients which are allowed to connect.
|
||||
; Equivalent to the FCGI_WEB_SERVER_ADDRS environment variable in the original
|
||||
; PHP FCGI (5.2.2+). Makes sense only with a tcp listening socket. Each address
|
||||
; must be separated by a comma. If this value is left blank, connections will be
|
||||
; accepted from any ip address.
|
||||
; Default Value: any
|
||||
;listen.allowed_clients = 127.0.0.1
|
||||
|
||||
; Set permissions for unix socket, if one is used. In Linux, read/write
|
||||
; permissions must be set in order to allow connections from a web server. Many
|
||||
; BSD-derived systems allow connections regardless of permissions.
|
||||
; Default Values: user and group are set as the running user
|
||||
; mode is set to 0666
|
||||
;listen.owner = nginx
|
||||
;listen.group = nginx
|
||||
;listen.mode = 0660
|
||||
|
||||
; Unix user/group of processes
|
||||
; Note: The user is mandatory. If the group is not set, the default user's group
|
||||
; will be used.
|
||||
user = www-data
|
||||
group = www-data
|
||||
|
||||
; Choose how the process manager will control the number of child processes.
|
||||
; Possible Values:
|
||||
; static - a fixed number (pm.max_children) of child processes;
|
||||
; dynamic - the number of child processes are set dynamically based on the
|
||||
; following directives:
|
||||
; pm.max_children - the maximum number of children that can
|
||||
; be alive at the same time.
|
||||
; pm.start_servers - the number of children created on startup.
|
||||
; pm.min_spare_servers - the minimum number of children in 'idle'
|
||||
; state (waiting to process). If the number
|
||||
; of 'idle' processes is less than this
|
||||
; number then some children will be created.
|
||||
; pm.max_spare_servers - the maximum number of children in 'idle'
|
||||
; state (waiting to process). If the number
|
||||
; of 'idle' processes is greater than this
|
||||
; number then some children will be killed.
|
||||
; Note: This value is mandatory.
|
||||
pm = dynamic
|
||||
|
||||
; The number of child processes to be created when pm is set to 'static' and the
|
||||
; maximum number of child processes to be created when pm is set to 'dynamic'.
|
||||
; This value sets the limit on the number of simultaneous requests that will be
|
||||
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
|
||||
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
|
||||
; CGI.
|
||||
; Note: Used when pm is set to either 'static' or 'dynamic'
|
||||
; Note: This value is mandatory.
|
||||
pm.max_children = 50
|
||||
|
||||
; The number of child processes created on startup.
|
||||
; Note: Used only when pm is set to 'dynamic'
|
||||
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
|
||||
pm.start_servers = 2
|
||||
|
||||
; The desired minimum number of idle server processes.
|
||||
; Note: Used only when pm is set to 'dynamic'
|
||||
; Note: Mandatory when pm is set to 'dynamic'
|
||||
pm.min_spare_servers = 1
|
||||
|
||||
; The desired maximum number of idle server processes.
|
||||
; Note: Used only when pm is set to 'dynamic'
|
||||
; Note: Mandatory when pm is set to 'dynamic'
|
||||
pm.max_spare_servers = 3
|
||||
|
||||
; The number of requests each child process should execute before respawning.
|
||||
; This can be useful to work around memory leaks in 3rd party libraries. For
|
||||
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
|
||||
; Default Value: 0
|
||||
pm.max_requests = 5000
|
||||
|
||||
; The URI to view the FPM status page. If this value is not set, no URI will be
|
||||
; recognized as a status page. By default, the status page shows the following
|
||||
; information:
|
||||
; accepted conn - the number of request accepted by the pool;
|
||||
; pool - the name of the pool;
|
||||
; process manager - static or dynamic;
|
||||
; idle processes - the number of idle processes;
|
||||
; active processes - the number of active processes;
|
||||
; total processes - the number of idle + active processes.
|
||||
; max children reached - number of times, the process limit has been reached,
|
||||
; when pm tries to start more children (works only for
|
||||
; pm 'dynamic')
|
||||
; The values of 'idle processes', 'active processes' and 'total processes' are
|
||||
; updated each second. The value of 'accepted conn' is updated in real time.
|
||||
; Example output:
|
||||
; accepted conn: 12073
|
||||
; pool: www
|
||||
; process manager: static
|
||||
; idle processes: 35
|
||||
; active processes: 65
|
||||
; total processes: 100
|
||||
; max children reached: 1
|
||||
; By default the status page output is formatted as text/plain. Passing either
|
||||
; 'html' or 'json' as a query string will return the corresponding output
|
||||
; syntax. Example:
|
||||
; http://www.foo.bar/status
|
||||
; http://www.foo.bar/status?json
|
||||
; http://www.foo.bar/status?html
|
||||
; Note: The value must start with a leading slash (/). The value can be
|
||||
; anything, but it may not be a good idea to use the .php extension or it
|
||||
; may conflict with a real PHP file.
|
||||
; Default Value: not set
|
||||
pm.status_path = /phpstatus
|
||||
|
||||
; The ping URI to call the monitoring page of FPM. If this value is not set, no
|
||||
; URI will be recognized as a ping page. This could be used to test from outside
|
||||
; that FPM is alive and responding, or to
|
||||
; - create a graph of FPM availability (rrd or such);
|
||||
; - remove a server from a group if it is not responding (load balancing);
|
||||
; - trigger alerts for the operating team (24/7).
|
||||
; Note: The value must start with a leading slash (/). The value can be
|
||||
; anything, but it may not be a good idea to use the .php extension or it
|
||||
; may conflict with a real PHP file.
|
||||
; Default Value: not set
|
||||
ping.path = /phpping
|
||||
|
||||
; This directive may be used to customize the response of a ping request. The
|
||||
; response is formatted as text/plain with a 200 response code.
|
||||
; Default Value: pong
|
||||
ping.response = pong
|
||||
|
||||
; The timeout for serving a single request after which the worker process will
|
||||
; be killed. This option should be used when the 'max_execution_time' ini option
|
||||
; does not stop script execution for some reason. A value of '0' means 'off'.
|
||||
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
|
||||
; Default Value: 0
|
||||
;request_terminate_timeout = 0
|
||||
|
||||
; The timeout for serving a single request after which a PHP backtrace will be
|
||||
; dumped to the 'slowlog' file. A value of '0s' means 'off'.
|
||||
; Available units: s(econds)(default), m(inutes), h(ours), or d(ays)
|
||||
; Default Value: 0
|
||||
;request_slowlog_timeout = 0
|
||||
|
||||
; The log file for slow requests
|
||||
; Default Value: not set
|
||||
; Note: slowlog is mandatory if request_slowlog_timeout is set
|
||||
;slowlog = log/$pool.log.slow
|
||||
|
||||
; Set open file descriptor rlimit.
|
||||
; Default Value: system defined value
|
||||
;rlimit_files = 1024
|
||||
|
||||
; Set max core size rlimit.
|
||||
; Possible Values: 'unlimited' or an integer greater or equal to 0
|
||||
; Default Value: system defined value
|
||||
;rlimit_core = 0
|
||||
|
||||
; Chroot to this directory at the start. This value must be defined as an
|
||||
; absolute path. When this value is not set, chroot is not used.
|
||||
; Note: you can prefix with '$prefix' to chroot to the pool prefix or one
|
||||
; of its subdirectories. If the pool prefix is not set, the global prefix
|
||||
; will be used instead.
|
||||
; Note: chrooting is a great security feature and should be used whenever
|
||||
; possible. However, all PHP paths will be relative to the chroot
|
||||
; (error_log, sessions.save_path, ...).
|
||||
; Default Value: not set
|
||||
;chroot =
|
||||
|
||||
; Chdir to this directory at the start.
|
||||
; Note: relative path can be used.
|
||||
; Default Value: current directory or / when chroot
|
||||
;chdir = /var/www
|
||||
|
||||
; Redirect worker stdout and stderr into main error log. If not set, stdout and
|
||||
; stderr will be redirected to /dev/null according to FastCGI specs.
|
||||
; Note: on highloaded environement, this can cause some delay in the page
|
||||
; process time (several ms).
|
||||
; Default Value: no
|
||||
;catch_workers_output = yes
|
||||
|
||||
; Pass environment variables like LD_LIBRARY_PATH. All $VARIABLEs are taken from
|
||||
; the current environment.
|
||||
; Default Value: clean env
|
||||
;env[HOSTNAME] = $HOSTNAME
|
||||
;env[PATH] = /usr/local/bin:/usr/bin:/bin
|
||||
;env[TMP] = /tmp
|
||||
;env[TMPDIR] = /tmp
|
||||
;env[TEMP] = /tmp
|
||||
|
||||
; Additional php.ini defines, specific to this pool of workers. These settings
|
||||
; overwrite the values previously defined in the php.ini. The directives are the
|
||||
; same as the PHP SAPI:
|
||||
; php_value/php_flag - you can set classic ini defines which can
|
||||
; be overwritten from PHP call 'ini_set'.
|
||||
; php_admin_value/php_admin_flag - these directives won't be overwritten by
|
||||
; PHP call 'ini_set'
|
||||
; For php_*flag, valid values are on, off, 1, 0, true, false, yes or no.
|
||||
|
||||
; Defining 'extension' will load the corresponding shared extension from
|
||||
; extension_dir. Defining 'disable_functions' or 'disable_classes' will not
|
||||
; overwrite previously defined php.ini values, but will append the new value
|
||||
; instead.
|
||||
|
||||
; Note: path INI options can be relative and will be expanded with the prefix
|
||||
; (pool, global or /etc)
|
||||
|
||||
; Default Value: nothing is defined by default except the values in php.ini and
|
||||
; specified at startup with the -d argument
|
||||
;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com
|
||||
;php_flag[display_errors] = off
|
||||
;php_admin_value[error_log] = /var/log/fpm-php.www.log
|
||||
;php_admin_flag[log_errors] = on
|
||||
;php_admin_value[memory_limit] = 32M
|
||||
php_admin_value[disable_functions] = shell_exec
|
||||
25
docker/php/php.deploy.ini
Normal file
25
docker/php/php.deploy.ini
Normal file
@ -0,0 +1,25 @@
|
||||
zend.exception_ignore_args = off
|
||||
expose_php = off
|
||||
max_execution_time = 30
|
||||
max_input_vars = 1000
|
||||
upload_max_filesize = 64M
|
||||
post_max_size = 128M
|
||||
memory_limit = 256M
|
||||
error_reporting = E_ALL
|
||||
display_errors = off
|
||||
display_startup_errors = off
|
||||
log_errors = on
|
||||
error_log = /dev/stderr
|
||||
default_charset = UTF-8
|
||||
|
||||
[Date]
|
||||
date.timezone = ${TZ}
|
||||
|
||||
[mysqlnd]
|
||||
mysqlnd.collect_memory_statistics = off
|
||||
|
||||
[Assertion]
|
||||
zend.assertions = -1
|
||||
|
||||
[mbstring]
|
||||
mbstring.language = Neutral
|
||||
25
docker/php/php.development.ini
Normal file
25
docker/php/php.development.ini
Normal file
@ -0,0 +1,25 @@
|
||||
zend.exception_ignore_args = off
|
||||
expose_php = on
|
||||
max_execution_time = 30
|
||||
max_input_vars = 1000
|
||||
upload_max_filesize = 64M
|
||||
post_max_size = 128M
|
||||
memory_limit = 256M
|
||||
error_reporting = E_ALL
|
||||
display_errors = on
|
||||
display_startup_errors = on
|
||||
log_errors = on
|
||||
error_log = /dev/stderr
|
||||
default_charset = UTF-8
|
||||
|
||||
[Date]
|
||||
date.timezone = ${TZ}
|
||||
|
||||
[mysqlnd]
|
||||
mysqlnd.collect_memory_statistics = on
|
||||
|
||||
[Assertion]
|
||||
zend.assertions = 1
|
||||
|
||||
[mbstring]
|
||||
mbstring.language = Neutral
|
||||
1947
docker/php/php.ini
1947
docker/php/php.ini
File diff suppressed because it is too large
Load Diff
7
docker/php/xdebug.ini
Normal file
7
docker/php/xdebug.ini
Normal file
@ -0,0 +1,7 @@
|
||||
[xdebug]
|
||||
xdebug.mode = debug
|
||||
xdebug.start_with_request = yes
|
||||
xdebug.client_host = host.docker.internal
|
||||
xdebug.client_port = 9003
|
||||
xdebug.log = /tmp/xdebug.log
|
||||
xdebug.idekey = "PHPSTORM"
|
||||
12
install.sh
12
install.sh
@ -40,14 +40,18 @@ fi
|
||||
|
||||
cp .env-sail .env
|
||||
|
||||
docker compose down -v
|
||||
#docker compose down -v
|
||||
|
||||
docker compose build --no-cache
|
||||
#docker compose build
|
||||
|
||||
docker compose up --force-recreate
|
||||
#--no-cache
|
||||
|
||||
docker compose up
|
||||
|
||||
#--force-recreate
|
||||
|
||||
#
|
||||
#docker exec -it oc_php php artisan install --ready
|
||||
#docker exec -it oc_nginx COPY ./docker/nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
#php artisan migrate --all-addons --force
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user