1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

change docker555

This commit is contained in:
MoonTestUse1
2024-12-24 01:55:39 +06:00
parent ae90221652
commit 6c0669ddf4
2 changed files with 20 additions and 10 deletions

View File

@@ -3,23 +3,27 @@ version: '3.8'
services: services:
frontend: frontend:
build: build:
context: . context: ./frontend
dockerfile: docker/frontend/Dockerfile dockerfile: ../docker/frontend/Dockerfile
container_name: support-frontend container_name: support-frontend
restart: unless-stopped restart: unless-stopped
volumes:
- ./frontend:/app
- /app/node_modules
depends_on: depends_on:
- backend - backend
backend: backend:
build: build:
context: . context: ./backend
dockerfile: docker/backend/Dockerfile dockerfile: ../docker/backend/Dockerfile
container_name: support-backend container_name: support-backend
restart: unless-stopped restart: unless-stopped
environment: environment:
- TELEGRAM_BOT_TOKEN=7677506032:AAHEqNUr1lIUfNVbLwaWIaPeKKShsCyz3eo - TELEGRAM_BOT_TOKEN=7677506032:AAHEqNUr1lIUfNVbLwaWIaPeKKShsCyz3eo
- TELEGRAM_CHAT_ID=-1002037023574 - TELEGRAM_CHAT_ID=-1002037023574
volumes: volumes:
- ./backend:/app
- sqlite_data:/app/instance - sqlite_data:/app/instance
nginx: nginx:

View File

@@ -2,17 +2,23 @@ FROM node:18-alpine as build
WORKDIR /app WORKDIR /app
COPY frontend/package*.json ./ # Копируем только package.json и package-lock.json
COPY package*.json ./
RUN npm install RUN npm install
COPY frontend/ . # Копируем исходники
COPY . .
RUN npm run build RUN npm run build
FROM nginx:alpine FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
# Создаем необходимые директории и назначаем права # Копируем собранные файлы из build stage
COPY --from=build /app/dist /usr/share/nginx/html
# Копируем конфиг nginx
COPY nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf
# Создаем директории и назначаем права
RUN mkdir -p /var/cache/nginx \ RUN mkdir -p /var/cache/nginx \
/var/cache/nginx/client_temp \ /var/cache/nginx/client_temp \
/var/cache/nginx/proxy_temp \ /var/cache/nginx/proxy_temp \