mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
check nginx
This commit is contained in:
@@ -4,6 +4,9 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
dockerfile: docker/frontend/Dockerfile
|
dockerfile: docker/frontend/Dockerfile
|
||||||
container_name: support-frontend
|
container_name: support-frontend
|
||||||
|
volumes:
|
||||||
|
- ./frontend:/app
|
||||||
|
- /app/node_modules
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
@@ -24,13 +27,13 @@ services:
|
|||||||
- "8000"
|
- "8000"
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
build:
|
image: nginx:alpine
|
||||||
context: ./docker/nginx
|
|
||||||
dockerfile: Dockerfile
|
|
||||||
container_name: support-nginx
|
container_name: support-nginx
|
||||||
restart: unless-stopped
|
volumes:
|
||||||
|
- ./frontend/dist:/usr/share/nginx/html
|
||||||
|
- ./docker/nginx/conf.d:/etc/nginx/conf.d
|
||||||
ports:
|
ports:
|
||||||
- "80:80" # Меняем на стандартный порт 80
|
- "8080:80"
|
||||||
depends_on:
|
depends_on:
|
||||||
- frontend
|
- frontend
|
||||||
- backend
|
- backend
|
||||||
|
@@ -1,23 +1,18 @@
|
|||||||
FROM node:18-alpine as build
|
FROM node:18-alpine
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Установите зависимости
|
# Копируем package.json и package-lock.json
|
||||||
COPY frontend/package*.json ./
|
COPY frontend/package*.json ./
|
||||||
|
|
||||||
|
# Устанавливаем зависимости
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# Скопируйте исходный код и соберите приложение
|
# Копируем исходный код
|
||||||
COPY frontend/ .
|
COPY frontend/ .
|
||||||
|
|
||||||
|
# Собираем приложение
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
FROM nginx:alpine
|
# Оставляем контейнер запущенным
|
||||||
|
CMD ["tail", "-f", "/dev/null"]
|
||||||
# Скопируйте собранные файлы в Nginx
|
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
|
||||||
|
|
||||||
# Скопируйте конфигурацию Nginx
|
|
||||||
COPY docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
|
|
||||||
|
|
||||||
EXPOSE 80
|
|
||||||
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
|
@@ -1,10 +1,14 @@
|
|||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name 185.139.70.62; # Изменяем на IP сервера
|
server_name localhost;
|
||||||
|
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
|
# Добавляем заголовки для отладки
|
||||||
|
add_header X-Debug-Path $request_uri;
|
||||||
|
add_header X-Debug-Root $document_root;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
expires -1;
|
expires -1;
|
||||||
|
Reference in New Issue
Block a user