mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
change docker
This commit is contained in:
@@ -3,16 +3,16 @@ version: '3.8'
|
|||||||
services:
|
services:
|
||||||
frontend:
|
frontend:
|
||||||
build:
|
build:
|
||||||
context: ./frontend
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: docker/frontend/Dockerfile
|
||||||
container_name: support-frontend
|
container_name: support-frontend
|
||||||
volumes:
|
volumes:
|
||||||
- frontend_build:/app/dist
|
- frontend_build:/app/dist
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
build:
|
build:
|
||||||
context: ./backend
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: docker/backend/Dockerfile
|
||||||
container_name: support-backend
|
container_name: support-backend
|
||||||
environment:
|
environment:
|
||||||
- TELEGRAM_BOT_TOKEN=7677506032:AAHEqNUr1lIUfNVbLwaWIaPeKKShsCyz3eo
|
- TELEGRAM_BOT_TOKEN=7677506032:AAHEqNUr1lIUfNVbLwaWIaPeKKShsCyz3eo
|
||||||
@@ -27,8 +27,7 @@ services:
|
|||||||
- "80:80"
|
- "80:80"
|
||||||
volumes:
|
volumes:
|
||||||
- frontend_build:/usr/share/nginx/html:ro
|
- frontend_build:/usr/share/nginx/html:ro
|
||||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
- ./docker/nginx/conf.d:/etc/nginx/conf.d:ro
|
||||||
- ./nginx/conf.d:/etc/nginx/conf.d:ro
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- frontend
|
- frontend
|
||||||
- backend
|
- backend
|
||||||
|
@@ -2,9 +2,14 @@ FROM python:3.11-slim
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY requirements.txt .
|
# Копируем requirements.txt
|
||||||
|
COPY backend/requirements.txt .
|
||||||
|
|
||||||
|
# Устанавливаем зависимости
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
COPY . .
|
# Копируем исходники
|
||||||
|
COPY backend/ .
|
||||||
|
|
||||||
CMD ["uvicorn", "run.py"]
|
# Запускаем приложение
|
||||||
|
CMD ["python", "run.py"]
|
||||||
|
@@ -2,11 +2,18 @@ FROM node:18-alpine as builder
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package*.json ./
|
# Копируем файлы package.json
|
||||||
RUN npm install
|
COPY frontend/package*.json ./
|
||||||
|
|
||||||
COPY . .
|
# Устанавливаем зависимости
|
||||||
|
RUN npm ci
|
||||||
|
|
||||||
|
# Копируем исходники
|
||||||
|
COPY frontend/ ./
|
||||||
|
|
||||||
|
# Собираем приложение
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
# Финальный этап
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY --from=builder /app/dist /dist
|
COPY --from=builder /app/dist /dist
|
||||||
|
@@ -7,7 +7,6 @@ server {
|
|||||||
|
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
add_header Cache-Control "no-store, no-cache, must-revalidate";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
location /api/ {
|
location /api/ {
|
||||||
|
Reference in New Issue
Block a user