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:
context: .
dockerfile: docker/frontend/Dockerfile
container_name: frontend
networks:
- app-network
container_name: support-frontend
restart: unless-stopped
depends_on:
- backend
backend:
build:
@@ -22,17 +23,16 @@ services:
- app-network
nginx:
build:
context: .
dockerfile: docker/nginx/Dockerfile
container_name: nginx
ports:
- "80:80"
depends_on:
- frontend
- backend
networks:
- app-network
build:
context: .
dockerfile: docker/nginx/Dockerfile
container_name: support-nginx
restart: unless-stopped
ports:
- "80:80"
depends_on:
- frontend
- backend
networks:
app-network:

View File

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