mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
не факт что заработает) в5
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
frontend:
|
frontend:
|
||||||
build:
|
build:
|
||||||
@@ -21,15 +23,16 @@ services:
|
|||||||
- ./backend:/app
|
- ./backend:/app
|
||||||
- sqlite_data:/app/instance
|
- sqlite_data:/app/instance
|
||||||
ports:
|
ports:
|
||||||
- "8081:8000"
|
- "8000:8000"
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
build:
|
build:
|
||||||
context: ./docker/nginx
|
context: .
|
||||||
|
dockerfile: docker/nginx/Dockerfile
|
||||||
container_name: support-nginx
|
container_name: support-nginx
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "8080:80"
|
- "80:80"
|
||||||
depends_on:
|
depends_on:
|
||||||
- frontend
|
- frontend
|
||||||
- backend
|
- backend
|
||||||
|
|||||||
@@ -1,17 +1,7 @@
|
|||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
|
|
||||||
# Create required directories
|
COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf
|
||||||
RUN mkdir -p /var/cache/nginx \
|
COPY docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
|
||||||
/var/cache/nginx/client_temp \
|
|
||||||
/var/cache/nginx/proxy_temp \
|
|
||||||
/var/cache/nginx/fastcgi_temp \
|
|
||||||
/var/cache/nginx/uwsgi_temp \
|
|
||||||
/var/cache/nginx/scgi_temp \
|
|
||||||
/var/run
|
|
||||||
|
|
||||||
# Copy configuration files
|
|
||||||
COPY conf.d/default.conf /etc/nginx/conf.d/
|
|
||||||
COPY nginx.conf /etc/nginx/
|
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
|
|||||||
@@ -5,32 +5,15 @@ server {
|
|||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
# Основной маршрут для статических файлов
|
|
||||||
location / {
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
||||||
}
|
|
||||||
|
|
||||||
# Маршрут для админ-панели
|
|
||||||
location /admin {
|
|
||||||
alias /usr/share/nginx/html;
|
|
||||||
try_files $uri $uri/ /index.html;
|
|
||||||
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
|
||||||
}
|
|
||||||
|
|
||||||
# API прокси
|
|
||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_pass http://backend:8000/api/;
|
proxy_pass http://backend:8000;
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
proxy_connect_timeout 60s;
|
|
||||||
proxy_send_timeout 60s;
|
|
||||||
proxy_read_timeout 60s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Обработка ошибок
|
location / {
|
||||||
error_page 404 /index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user