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:
|
||||
frontend:
|
||||
build:
|
||||
@@ -21,15 +23,16 @@ services:
|
||||
- ./backend:/app
|
||||
- sqlite_data:/app/instance
|
||||
ports:
|
||||
- "8081:8000"
|
||||
- "8000:8000"
|
||||
|
||||
nginx:
|
||||
build:
|
||||
context: ./docker/nginx
|
||||
context: .
|
||||
dockerfile: docker/nginx/Dockerfile
|
||||
container_name: support-nginx
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8080:80"
|
||||
- "80:80"
|
||||
depends_on:
|
||||
- frontend
|
||||
- backend
|
||||
|
@@ -1,17 +1,7 @@
|
||||
FROM nginx:alpine
|
||||
|
||||
# Create required directories
|
||||
RUN mkdir -p /var/cache/nginx \
|
||||
/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/
|
||||
COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
|
@@ -5,32 +5,15 @@ server {
|
||||
root /usr/share/nginx/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/ {
|
||||
proxy_pass http://backend:8000/api/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_pass http://backend:8000;
|
||||
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_connect_timeout 60s;
|
||||
proxy_send_timeout 60s;
|
||||
proxy_read_timeout 60s;
|
||||
}
|
||||
|
||||
# Обработка ошибок
|
||||
error_page 404 /index.html;
|
||||
}
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user