1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00
This commit is contained in:
MoonTestUse1
2024-12-26 01:33:56 +06:00
parent b332b91a80
commit 5020ac3a37
2 changed files with 26 additions and 23 deletions

View File

@@ -3,9 +3,10 @@ services:
build: build:
context: . context: .
dockerfile: docker/frontend/Dockerfile dockerfile: docker/frontend/Dockerfile
container_name: frontend container_name: support-frontend
networks: restart: unless-stopped
- app-network depends_on:
- backend
backend: backend:
build: build:
@@ -22,17 +23,16 @@ services:
- app-network - app-network
nginx: nginx:
build: build:
context: . context: .
dockerfile: docker/nginx/Dockerfile dockerfile: docker/nginx/Dockerfile
container_name: nginx container_name: support-nginx
ports: restart: unless-stopped
- "80:80" ports:
depends_on: - "80:80"
- frontend depends_on:
- backend - frontend
networks: - backend
- app-network
networks: networks:
app-network: app-network:

View File

@@ -3,26 +3,29 @@ FROM node:18-alpine as build
WORKDIR /app WORKDIR /app
# Copy package files # Копируем package.json и package-lock.json
COPY frontend/package*.json ./ COPY frontend/package*.json ./
# Install dependencies # Устанавливаем зависимости
RUN npm ci RUN npm install
# Copy source code # Копируем исходный код
COPY frontend/ ./ COPY frontend/ ./
# Build the app # Собираем приложение
RUN npm run build RUN npm run build
# Production stage # Production stage
FROM nginx:alpine FROM nginx:alpine
# Copy built files # Копируем собранные файлы
COPY --from=build /app/dist /usr/share/nginx/html COPY --from=build /app/dist /usr/share/nginx/html/
# Add nginx config # Удаляем дефолтную страницу nginx
COPY docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf RUN rm -rf /usr/share/nginx/html/50x.html
# Копируем конфигурацию nginx
COPY docker/nginx/conf.d/default.conf /etc/nginx/conf.d/
EXPOSE 80 EXPOSE 80