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:
frontend:
build:
context: .
dockerfile: docker/frontend/Dockerfile
context: ./frontend
dockerfile: ../docker/frontend/Dockerfile
container_name: support-frontend
restart: unless-stopped
volumes:
- ./frontend:/app
- /app/node_modules
depends_on:
- backend
backend:
build:
context: .
dockerfile: docker/backend/Dockerfile
context: ./backend
dockerfile: ../docker/backend/Dockerfile
container_name: support-backend
restart: unless-stopped
environment:
- TELEGRAM_BOT_TOKEN=7677506032:AAHEqNUr1lIUfNVbLwaWIaPeKKShsCyz3eo
- TELEGRAM_CHAT_ID=-1002037023574
volumes:
- ./backend:/app
- sqlite_data:/app/instance
nginx:

View File

@@ -2,17 +2,23 @@ FROM node:18-alpine as build
WORKDIR /app
COPY frontend/package*.json ./
# Копируем только package.json и package-lock.json
COPY package*.json ./
RUN npm install
COPY frontend/ .
# Копируем исходники
COPY . .
RUN npm run build
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 \
/var/cache/nginx/client_temp \
/var/cache/nginx/proxy_temp \