Skip to content

Commit

Permalink
Fix setting ACLs when host machine is Linux (#21)
Browse files Browse the repository at this point in the history
- Update nginx config to be more similar to cakephp 4 docs
- Fix condition for setting ACLs when host machine is linux
- Update readme with link to php8.0 repo
  • Loading branch information
cnizzardini authored Jan 16, 2022
1 parent 6a55b00 commit c32a1e6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions .docker/nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ server {
index index.php;

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

location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
include fastcgi_params;
}
}
}
6 changes: 3 additions & 3 deletions .docker/php/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/cakephp' ]; then

mkdir -p logs tmp

echo "HOST OS: "$HOST_OS""
if ["$HOST_OS" = 'Linux']; then
echo "setting ACLs..."
echo "HOST OS: $HOST_OS"
if [[ $HOST_OS == *"Linux"* ]]; then
echo "Setting ACLs..."
setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX logs
setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX tmp
setfacl -R -m g:nginx:rwX /srv/app
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# container
# @see https://hub.docker.com/repository/docker/cnizzardini/php-fpm-alpine
# @see https://github.com/cnizzardini/php-fpm-alpine/tree/php-7.4
# @see https://github.com/cnizzardini/php-fpm-alpine/tree/php-8.0
FROM cnizzardini/php-fpm-alpine:8.0-latest AS cakephp_php

ARG ENV=prod
Expand Down

0 comments on commit c32a1e6

Please sign in to comment.