-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa8f28e
commit a279684
Showing
8 changed files
with
72 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add Cache-Control header on js/css files | ||
location ~* .(?:css|js)$ { | ||
expires 1y; | ||
add_header Cache-Control "public, max-age=60 s-maxage=3600"; | ||
} | ||
|
||
location / { | ||
# try to serve file directly, fallback to rewrite | ||
try_files $uri @rewriteapp; | ||
} | ||
|
||
location @rewriteapp { | ||
# rewrite all to index.php | ||
rewrite ^(.*)$ /index.php/$1 last; | ||
} | ||
|
||
location ~ ^/index\.php(/|$) { | ||
try_files @heroku-fcgi @heroku-fcgi; | ||
# ensure that /index.php isn't accessible directly, but only through a rewrite | ||
internal; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: '3.4' | ||
|
||
services: | ||
web: | ||
container_name: blog.nginx | ||
image: nginx:latest | ||
ports: [ "8080:80" ] | ||
volumes: | ||
- ".:/var/www/html:ro" | ||
- "./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf" | ||
depends_on: [ app ] | ||
links: [ app ] | ||
|
||
app: | ||
container_name: blog.app | ||
build: | ||
context: . | ||
dockerfile: ./docker/Dockerfile | ||
target: app | ||
volumes: [ ".:/var/www/html" ] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
FROM php:8.2-apache AS app | ||
FROM php:8.2-fpm-alpine AS app | ||
|
||
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ | ||
|
||
RUN install-php-extensions gd zip opcache intl | ||
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer | ||
|
||
RUN a2enmod headers | ||
COPY docker/apache2/default.conf /etc/apache2/sites-available/000-default.conf | ||
COPY docker/apache2/mods-enabled/headers.conf /etc/apache2/mods-enabled/headers.conf | ||
|
||
WORKDIR /var/www |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
server { | ||
root /var/www/html/public; | ||
|
||
location ~* .(?:css|js)$ { | ||
expires 1y; | ||
add_header Cache-Control "public, max-age=60 s-maxage=3600"; | ||
} | ||
|
||
location / { | ||
try_files $uri /index.php$is_args$args; | ||
} | ||
|
||
location ~ ^/index\.php(/|$) { | ||
fastcgi_pass app:9000; | ||
fastcgi_split_path_info ^(.+\.php)(/.*)$; | ||
include fastcgi_params; | ||
|
||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; | ||
fastcgi_param DOCUMENT_ROOT $realpath_root; | ||
|
||
internal; | ||
} | ||
|
||
location ~ \.php$ { | ||
return 404; | ||
} | ||
|
||
error_log /var/log/nginx/project_error.log; | ||
access_log /var/log/nginx/project_access.log; | ||
} |
This file was deleted.
Oops, something went wrong.