Skip to content

Commit

Permalink
Full update last release, and replace to org
Browse files Browse the repository at this point in the history
  • Loading branch information
RadgRabbi committed Nov 23, 2023
0 parents commit e3de344
Show file tree
Hide file tree
Showing 804 changed files with 82,932 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .docker/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
FROM php:8.2-fpm

RUN apt-get update && apt-get install -y \
git \
wget \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
libpq-dev \
zip \
unzip \
libgmp-dev

RUN apt-get clean && rm -rf /var/lib/apt/lists/*

RUN docker-php-ext-install pdo pdo_mysql mbstring exif pcntl bcmath gd sockets gmp

RUN pecl install -o -f redis \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable redis

RUN docker-php-ext-install opcache \
&& docker-php-ext-configure opcache --enable-opcache

RUN pecl install xdebug \
&& docker-php-ext-enable xdebug

RUN git clone https://github.com/edenhill/librdkafka.git \
&& ( \
cd librdkafka \
&& ./configure \
&& make \
&& make install \
)

RUN pecl install rdkafka \
&& echo "extension=rdkafka.so" > /usr/local/etc/php/conf.d/rdkafka.ini

ARG UID
ARG GID

RUN groupadd -g $GID www
RUN useradd -u $UID -ms /bin/bash -g www www

ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz

COPY local.ini /usr/local/etc/php/conf.d/local.ini

USER www

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

8 changes: 8 additions & 0 deletions .docker/app/local.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[xdebug]

xdebug.mode=debug
xdebug.client_host=host.docker.internal
xdebug.start_with_request=trigger
output_buffering = On

#disable_functions = "show_source, system, shell_exec, exec"
52 changes: 52 additions & 0 deletions .docker/app_test/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
FROM php:8.2-fpm

RUN apt-get update && apt-get install -y \
git \
wget \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
libpq-dev \
zip \
unzip \
libgmp-dev

RUN apt-get clean && rm -rf /var/lib/apt/lists/*

RUN docker-php-ext-install pdo pdo_mysql mbstring exif pcntl bcmath gd sockets gmp

RUN pecl install -o -f redis \
&& rm -rf /tmp/pear \
&& docker-php-ext-enable redis

RUN docker-php-ext-install opcache \
&& docker-php-ext-configure opcache --enable-opcache

RUN pecl install xdebug \
&& docker-php-ext-enable xdebug

RUN git clone https://github.com/edenhill/librdkafka.git \
&& ( \
cd librdkafka \
&& ./configure \
&& make \
&& make install \
)

RUN pecl install rdkafka \
&& echo "extension=rdkafka.so" > /usr/local/etc/php/conf.d/rdkafka.ini

ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz

COPY .docker/app_test/local.ini /usr/local/etc/php/conf.d/local.ini
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

WORKDIR /var/www/html

COPY . .


5 changes: 5 additions & 0 deletions .docker/app_test/local.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[xdebug]

xdebug.mode=debug
xdebug.client_host=host.docker.internal
xdebug.start_with_request=trigger
108 changes: 108 additions & 0 deletions .docker/nginx/conf/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
upstream php-upstream {
server app:9000;
}

server {
listen 80 deferred reuseport default;
listen [::]:80 deferred reuseport default;

server_name _ default_server;
charset utf-8;
root /var/www/html/public;
index index.php index.html;

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

error_page 404 /index.php;

rewrite ^([^.]*?\/)\/+(.*)$ $1$2 permanent;

location ~ (/\.ht|/\.git|/\.gitignore) {
deny all;
}

location ~ /\.(?!well-known).* {
deny all;
}

location = /favicon.png {
log_not_found off;
access_log off;
}

location = /robots.txt {
log_not_found off;
access_log off;
}

location ~* ^.+\.(jpg|jpeg|gif|png|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar)$ {
try_files $uri /index.php;
log_not_found off;
access_log off;

expires 30d;
add_header Cache-Control public;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'; frame-ancestors 'self';" always;
}

location ~* \.(?:svgz?|ttf|ttc|otf|eot|woff2?)$ {
log_not_found off;
access_log off;

expires 30d;
add_header Cache-Control public;
add_header Access-Control-Allow-Origin "*";
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'; frame-ancestors 'self';" always;
}

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location ~ \.php$ {
if ($request_uri ~* "^(.*/)index\.php$") {
return 301 $1;
}

if ($request_method = OPTIONS) {
add_header Access-Control-Allow-Origin "http://localhost:8080" always;
add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS, HEAD" always;
add_header Access-Control-Allow-Headers "Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Recaptcha-Response, X-Sms-Otp, X-Google-Otp, sentry-trace" always;
add_header Access-Control-Allow-Credentials 'true' always;
}

if ($request_method ~* "(GET|POST|PUT|DELETE)") {
add_header Access-Control-Allow-Origin "http://localhost:8080" always;
add_header Access-Control-Allow-Headers "Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Recaptcha-Response, X-Sms-Otp, X-Google-Otp, sentry-trace" always;
add_header Access-Control-Allow-Credentials 'true' always;
}


add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'; frame-ancestors 'self';" always;

client_body_buffer_size 64m;
client_max_body_size 64m;

include fastcgi_params;

fastcgi_pass php-upstream;
fastcgi_send_timeout 21600;
fastcgi_read_timeout 21600;
fastcgi_index index.php;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
fastcgi_param SERVER_NAME $host;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
}
}
59 changes: 59 additions & 0 deletions .docker/nginx/conf/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
user nginx;
worker_processes auto;
pid /run/nginx.pid;

events {
worker_connections 2048;
multi_accept on;
use epoll;
}

http {
client_body_buffer_size 4m;
client_body_timeout 60s;
client_header_buffer_size 2k;
client_header_timeout 60s;
client_max_body_size 20m;
keepalive_timeout 60s;
large_client_header_buffers 4 8k;
reset_timedout_connection on;
send_timeout 60s;
sendfile on;
server_name_in_redirect off;
server_names_hash_bucket_size 512;
server_names_hash_max_size 512;
server_tokens off;
tcp_nodelay on;
tcp_nopush on;
types_hash_max_size 2048;
merge_slashes off;
error_log /var/log/nginx/default-error.log;
access_log /var/log/nginx/default-access.log;

include /etc/nginx/mime.types;
default_type application/octet-stream;

# Compression
gzip on;
gzip_static on;
gzip_vary on;
gzip_comp_level 6;
gzip_min_length 512;
gzip_buffers 8 64k;
gzip_types text/plain text/css text/javascript text/js text/xml application/json application/javascript application/x-javascript application/xml application/xml+rss application/x-font-ttf image/svg+xml font/opentype;
gzip_proxied any;
gzip_disable "msie6";
gzip_http_version 1.0;

# Log format
log_format postdata '$remote_addr - $remote_user [$time_local] "$request" $status $bytes_sent "$http_referer" "$http_user_agent" "$request_body"';

# File cache settings
open_file_cache max=10000 inactive=30s;
open_file_cache_valid 60s;
open_file_cache_min_uses 2;
open_file_cache_errors off;

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-available/*;
}
Loading

0 comments on commit e3de344

Please sign in to comment.