docker env is working

This commit is contained in:
2024-06-18 15:03:29 +02:00
commit 7390c5d9be
26 changed files with 1155 additions and 0 deletions

9
Docker/nginx/Dockerfile Normal file
View File

@@ -0,0 +1,9 @@
FROM nginx:latest
RUN apt-get update \
&& apt-get install -y \
vim
COPY ./default.conf /etc/nginx/conf.d/default.conf
COPY ./bashrc /root/.bashrc
COPY ./inputrc /root/.inputrc

3
Docker/nginx/bashrc Normal file
View File

@@ -0,0 +1,3 @@
PS1='\e[36m\e[1mNGINX\e[0m:\e[90m\w\e[0m\n$ '
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'

84
Docker/nginx/default.conf Normal file
View File

@@ -0,0 +1,84 @@
upstream app{
server app:5173;
}
server {
listen 80 default_server;
# root /var/www/html/api/src/web;
# root /var/www/html/app/dist;
index index.html index.php;
server_name *.caravane.fr;
charset utf-8;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Ssl on;
proxy_cache off;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://app;
proxy_redirect off;
}
# https://serversforhackers.com/c/nginx-php-in-subdirectory
location @api {
rewrite ^/api/(.*)$ /api/index.php;
}
location /api {
# rewrite /api/(.*)$ /$1 break;
# root /var/www/html/api/src/web;
alias /var/www/html/api/src/web/;
# index index.php;
# try_files $uri $uri/ /index.php?$query_string;
try_files $uri $uri/ @api;
error_log /var/log/nginx/api-error.log debug;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass api:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_intercept_errors off;
fastcgi_buffers 16 32k;
fastcgi_buffer_size 64k;
fastcgi_busy_buffers_size 64k;
fastcgi_read_timeout 150;
}
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log on;
error_log /var/log/nginx/app-error.log error;
sendfile off;
client_max_body_size 100m;
# location ~ \.php$ {
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# fastcgi_pass api:9000;
# fastcgi_index index.php;
# include fastcgi_params;
# fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# fastcgi_intercept_errors off;
# fastcgi_buffer_size 16k;
# fastcgi_buffers 4 16k;
# fastcgi_read_timeout 150;
# }
location ~ /\.ht {
deny all;
}
}

2
Docker/nginx/inputrc Normal file
View File

@@ -0,0 +1,2 @@
set show-all-if-ambiguous on
set completion-ignore-case on