-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
02:06 - Atualizando o Nginx para servir a aplicação
- Loading branch information
Showing
4 changed files
with
74 additions
and
10 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,27 @@ | ||
FROM bitnami/laravel:10 AS builder | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN composer install --optimize-autoloader --no-dev | ||
|
||
RUN npm install && npm run build | ||
|
||
FROM php:8.2.10-fpm-alpine AS runner | ||
|
||
WORKDIR /var/www | ||
|
||
RUN rm -rf /var/www/html | ||
|
||
RUN docker-php-ext-install pdo_mysql | ||
|
||
COPY --from=builder /app . | ||
|
||
RUN ln -s public html | ||
|
||
RUN chown -R www-data:www-data /var/www | ||
|
||
EXPOSE 9000 | ||
|
||
CMD [ "php-fpm" ] |
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
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
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,14 +1,32 @@ | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
listen [::]:80; | ||
server_name example.com; | ||
root /var/www/html; | ||
|
||
add_header X-Frame-Options "SAMEORIGIN"; | ||
add_header X-Content-Type-Options "nosniff"; | ||
|
||
index index.php; | ||
|
||
charset utf-8; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.php?$query_string; | ||
} | ||
|
||
error_page 500 502 503 503 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
|
||
location = /favicon.ico { access_log off; log_not_found off; } | ||
location = /robots.txt { access_log off; log_not_found off; } | ||
|
||
error_page 404 /index.php; | ||
|
||
location ~ \.php$ { | ||
fastcgi_pass app-prod:9000; | ||
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name; | ||
include fastcgi_params; | ||
} | ||
|
||
location ~ /\.(?!well-known).* { | ||
deny all; | ||
} | ||
} |