Skip to content

Commit

Permalink
Merge pull request #92 from kangketikonlen/stable
Browse files Browse the repository at this point in the history
[23-11-2023 21:48] stable - Request merge stable to main branch
  • Loading branch information
kangketikonlen authored Nov 23, 2023
2 parents c50f11f + 3893f55 commit 6aad4bb
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 31 deletions.
6 changes: 4 additions & 2 deletions .docker/conf/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ server {
error_page 404 /index.php;

location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

location ~ /\.(?!well-known).* {
deny all;
}
Expand Down
59 changes: 36 additions & 23 deletions .docker/conf/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,39 +1,52 @@
user www-data;
# /etc/nginx/nginx.conf

user nginx;
worker_processes auto;
pid /run/nginx.pid;
pcre_jit on;

include /etc/nginx/modules-enabled/*.conf;
error_log /var/log/nginx/error.log warn;

error_log /var/log/nginx/error.log notice;
include /etc/nginx/modules/*.conf;
include /etc/nginx/conf.d/*.conf;

events {
worker_connections 2048;
worker_connections 2048;
}

http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;

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

# Logging Settings
log_format main '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent';
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log;

# Gzip Settings
include /etc/nginx/mime.types;
default_type application/octet-stream;
server_tokens off;
client_max_body_size 1m;
sendfile on;
tcp_nopush on;

ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:2m;
ssl_session_timeout 1h;
ssl_session_tickets off;

# Gzip Settings
gzip on;
gzip_types text/plain text/css text/xml application/json application/javascript;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;

# Virtual Host Configs
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
# Helper variable for proxying websockets.
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}


# Logging Settings
log_format main '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent';
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log;

# Includes virtual hosts configs.
include /etc/nginx/http.d/*.conf;
}
8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,20 @@ RUN dos2unix /usr/local/bin/docker-php-entrypoint

# copy nginx configuration
COPY .docker/conf/nginx.conf /etc/nginx/nginx.conf
COPY .docker/conf/default.conf /etc/nginx/sites-available/default
COPY .docker/conf/default.conf /etc/nginx/http.d/default.conf

# install composer dependencies
RUN composer install --no-dev --no-scripts --no-autoloader --ansi --no-interaction \
&& composer dump-autoload -o

# install nodejs dependencies
RUN npm install --silent --no-optional \
&& npm run production

# Create laravel log file.
RUN touch /var/www/app/storage/logs/laravel.log
RUN chmod -R 0777 /var/www/app/storage/logs

# setup ownership
RUN chmod -R 777 /var/www/app/storage \
&& chmod -R 777 /var/www/app/bootstrap/cache \
&& chown -R :www-data /var/www/app
&& chown -R :nginx /var/www/app

# Setup docker cronjobs
COPY .docker/docker-php-schedule /etc/cron.d/laravel-cron
Expand Down

0 comments on commit 6aad4bb

Please sign in to comment.