Files
TestingWebApp/docker-compose.dev.yml
T
Константин Лебединский 47279c72e3 chore: фронт :3107, API :3001 (Docker, Vite, CORS, доки)
- compose: testing-web 3107:80, testing-backend 3001:3001, PORT+FRONTEND_URL
- nginx → testing-backend:3001; Vite 3107, proxy /api → 3001
- server default PORT 3001; Dockerfile EXPOSE 3001; CORS dev — localhost:3107
- README, журнал, user guide

Made-with: Cursor
2026-04-24 23:14:33 +05:00

55 lines
2.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Система тестирования + общий Postgres (Postgres_TG_Bots / hr_postgres_dev).
# Требуется: сеть hr_postgres_dev_net и поднятый hr_postgres_dev.
# cd ../Postgres_TG_Bots && docker compose -f docker-compose.dev.yml up -d
# База clinic_tests: один раз
# psql "postgresql://hr_bot_user:hrbot123@localhost:5432/postgres" -c "CREATE DATABASE clinic_tests;"
#
# Запуск: из каталога TestingWebApp
# docker compose -f docker-compose.dev.yml up --build
# UI: http://localhost:3107 (Nginx: /api → backend:3001), API с хоста: http://localhost:3001
services:
testing-backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: testing_webapp_backend
# LLM и прочие секреты из хоста (не копируются в образ — см. .dockerignore)
env_file:
- ./backend/.env
environment:
DATABASE_URL: postgresql://hr_bot_user:hrbot123@hr_postgres_dev:5432/clinic_tests
JWT_SECRET: ${JWT_SECRET:-testing_webapp_jwt_dev}
# development: httpOnly-cookie без Secure (иначе на http://localhost:3107 логин не сработает)
NODE_ENV: development
FRONTEND_URL: http://localhost:3107
PORT: "3001"
# Вход теми же учётками, что в HR: проверка пароля в hr_bot_test + привязка сотрудника по web_login.
# Без HR_AUTH / HR_DATABASE_URL логин ищется только в clinic_tests.users (локальные dev-учётки).
HR_AUTH: ${HR_AUTH:-1}
HR_DATABASE_URL: postgresql://hr_bot_user:hrbot123@hr_postgres_dev:5432/hr_bot_test
# Прямой доступ к API с хоста (Vite proxy в dev: см. frontend/vite.config.js)
ports:
- "3001:3001"
networks:
- app
- postgres
testing-web:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: testing_webapp_nginx
depends_on:
- testing-backend
ports:
- "3107:80"
networks:
- app
networks:
app:
postgres:
name: hr_postgres_dev_net
external: true