2025-01-28 17:52:48 +01:00
|
|
|
map $original_uri $api_uri {
|
|
|
|
|
~^/api(/.*$) $1;
|
|
|
|
|
default $original_uri;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
server {
|
2025-01-29 16:00:01 +01:00
|
|
|
listen 80;
|
|
|
|
|
server_name localhost;
|
|
|
|
|
root /usr/share/nginx/html/public;
|
Enhance Docker Configuration and Health Checks (#761)
* Enhance Docker Configuration and Health Checks
- Added PHP configuration settings in `docker-compose.dev.yml` and `docker-compose.yml` to improve memory management and execution limits, ensuring better performance for PHP applications.
- Introduced health checks for various services including `api`, `api-worker`, `api-scheduler`, `ui`, `redis`, and `db` to ensure service availability and reliability.
- Updated environment variables in `.env.docker` and `client/.env.docker` to include new keys for H-Captcha and reCAPTCHA, enhancing security features.
- Refactored the PHP-FPM entrypoint script to apply PHP configurations dynamically based on environment variables, improving flexibility in deployment.
- Removed outdated PHP configuration files to streamline the Docker setup.
These changes aim to enhance the overall stability, performance, and security of the application in a Dockerized environment.
* Refactor Dockerfile for Improved Build Process
- Changed the Dockerfile to utilize a multi-stage build approach, separating the build and runtime environments for better efficiency.
- Introduced a builder stage using the PHP CLI image to install dependencies and extensions, optimizing the final image size.
- Removed unnecessary installation steps and combined related commands to streamline the Dockerfile, enhancing readability and maintainability.
- Updated the runtime stage to use the PHP FPM Alpine image, ensuring a smaller and more secure production environment.
These changes aim to improve the build process, reduce image size, and enhance the overall performance of the Dockerized application.
2025-05-20 19:20:44 +02:00
|
|
|
client_max_body_size ${NGINX_MAX_BODY_SIZE};
|
2025-01-28 17:52:48 +01:00
|
|
|
|
|
|
|
|
access_log /dev/stdout;
|
2025-01-29 16:00:01 +01:00
|
|
|
error_log /dev/stderr error;
|
2025-01-28 17:52:48 +01:00
|
|
|
|
|
|
|
|
index index.html index.htm index.php;
|
|
|
|
|
|
2025-01-29 16:00:01 +01:00
|
|
|
# Frontend proxy
|
2025-01-28 17:52:48 +01:00
|
|
|
location / {
|
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
|
proxy_pass http://ui:3000;
|
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
|
|
proxy_set_header X-Forwarded-Host $host;
|
|
|
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
2025-01-29 16:00:01 +01:00
|
|
|
proxy_set_header Connection "Upgrade";
|
2025-01-28 17:52:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# HMR websocket support
|
|
|
|
|
location /_nuxt {
|
|
|
|
|
proxy_pass http://ui:3000;
|
|
|
|
|
proxy_http_version 1.1;
|
2025-01-29 16:00:01 +01:00
|
|
|
proxy_set_header Host $host;
|
2025-01-28 17:52:48 +01:00
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
|
proxy_cache_bypass $http_upgrade;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-29 16:00:01 +01:00
|
|
|
# API handling
|
2025-01-28 17:52:48 +01:00
|
|
|
location ~/(api|open|local\/temp|forms\/assets)/ {
|
2025-01-29 16:00:01 +01:00
|
|
|
set $original_uri $uri;
|
|
|
|
|
try_files $uri $uri/ /index.php$is_args$args;
|
2025-01-28 17:52:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
location ~ \.php$ {
|
|
|
|
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
|
|
|
|
fastcgi_pass api:9000;
|
|
|
|
|
fastcgi_index index.php;
|
|
|
|
|
include fastcgi_params;
|
2025-01-29 16:00:01 +01:00
|
|
|
fastcgi_param SCRIPT_FILENAME $document_root/index.php;
|
2025-01-28 17:52:48 +01:00
|
|
|
fastcgi_param REQUEST_URI $api_uri;
|
2025-01-29 16:00:01 +01:00
|
|
|
fastcgi_read_timeout 300;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# Deny access to . files
|
|
|
|
|
location ~ /\. {
|
|
|
|
|
deny all;
|
2025-01-28 17:52:48 +01:00
|
|
|
}
|
|
|
|
|
}
|