diff --git a/nginx/Dockerfile b/nginx/Dockerfile new file mode 100644 index 0000000..3901907 --- /dev/null +++ b/nginx/Dockerfile @@ -0,0 +1,12 @@ +FROM nginx:alpine + +ENV AKAUNTING_VERSION 2.0.8 + +RUN apk update && apk add --no-progress -q wget unzip + +RUN wget https://github.com/akaunting/akaunting/releases/download/${AKAUNTING_VERSION}/Akaunting_${AKAUNTING_VERSION}-Stable.zip +RUN mkdir -p /var/www/akaunting +RUN unzip Akaunting_${AKAUNTING_VERSION}-Stable.zip -d /var/www/akaunting +RUN rm Akaunting_${AKAUNTING_VERSION}-Stable.zip + +RUN chmod -R 777 /var/www/akaunting diff --git a/nginx/conf.d/akaunting.test.conf b/nginx/conf.d/akaunting.conf similarity index 77% rename from nginx/conf.d/akaunting.test.conf rename to nginx/conf.d/akaunting.conf index ef85bcc..4ef5fdf 100644 --- a/nginx/conf.d/akaunting.test.conf +++ b/nginx/conf.d/akaunting.conf @@ -1,12 +1,12 @@ server { - server_name akaunting.test; + server_name akaunting; listen 80 default_server; access_log /dev/stdout; error_log /dev/stdout; - root /var/www/akaunting.test; - index index.php index.html; + root /var/www/akaunting; + index index.html index.htm index.php; add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; @@ -20,7 +20,7 @@ server { } # Prevent Direct Access To Protected Folders - location ~ ^/(^app$|bootstrap|config|database|resources|routes|storage|tests|artisan) { + location ~ ^/(^app$|bootstrap|config|database|overrides|resources|routes|storage|tests|artisan) { deny all; } @@ -29,15 +29,17 @@ server { deny all; } + error_page 404 /index.php; + location / { try_files $uri $uri/ /index.php?$query_string; - gzip_static on; } + # Pass PHP Scripts To FastCGI Server location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_pass app:9000; + fastcgi_pass php:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;