Files
mtusi2026lab7-safronov/.github/ci/compose.yml
T
ricoromaandClaude Opus 5.5 089d78609d chore: port lab 6 solution into the lab 7 skeleton
Source: mtusi2026lab6-safronov, solution/bvt2301-safronov, 6c6a065.
Files follow AGENTS.md, "Переход в следующую лабу". Contracts, public
tests, README, REPORT and evidence of lab 6 are not carried over; infra
and scripts of the lab 7 skeleton stay as they are.
Makefile is the lab 6 one with the lab 7 skeleton part restored
(HTTPS BASE_URL on 8443, test-security); .gitignore and .dockerignore
are taken from lab 6 because both skeletons have the same files;
.env.example is the lab 6 one without changes.
The compose project, image and CI prefix are renamed to lab7, and
references to the previous lab now name lab6.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 03:59:04 +03:00

154 lines
5.0 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.
# Стенд в CI: docker-compose.yml + этот файл (COMPOSE_FILE job
# application, .github/workflows/application.yml). Раннер Gitea
# (act_runner) запускает job в контейнере рядом со стендом, на том же
# Docker. Файлы рабочего каталога есть только в контейнере job, а bind
# mount ищет их на хосте раннера; порты на 127.0.0.1 хоста из job не
# видны и на общем хосте заняли бы чужие. Поэтому отличия от рабочего
# стенда только такие:
# - конфиги — configs из переменных окружения (их выставляет
# .github/ci/stand-env.sh): compose копирует содержимое в контейнер при
# создании, пути на хосте не нужно;
# - портов на хосте нет: job подключается к сети стенда и ходит на
# haproxy по имени;
# - образ API — с тегом прогона: тег mtusi-messenger:lab7 на общем хосте
# раннера может собрать и чужой job.
# Остальное — сервисы, лимиты, volumes, секреты по сервисам — как в
# рабочем стенде. Нужен Compose ≥ 2.24 (!reset).
services:
postgres:
ports: !reset []
valkey:
ports: !reset []
volumes: !reset []
configs:
- source: valkey_conf
target: /usr/local/etc/valkey/valkey.conf
s3:
ports: !reset []
s3-bootstrap:
volumes: !reset []
configs:
- source: s3_bootstrap
target: /opt/s3/bootstrap.sh
rabbitmq:
ports: !reset []
# !override: bind mount конфига заменяют configs, volume данных остаётся
volumes: !override
- rabbitmq_data:/var/lib/rabbitmq
configs:
- source: rabbitmq_conf
target: /etc/rabbitmq/conf.d/90-messenger.conf
migrate:
image: &ci-image mtusi-messenger:${CI_IMAGE_TAG:?CI_IMAGE_TAG is not set}
volumes: !reset []
configs: &config-toml
- source: config_toml
target: /app/config.toml
api:
image: *ci-image
volumes: !reset []
configs: *config-toml
cleaner:
image: *ci-image
volumes: !reset []
configs: *config-toml
relay:
image: *ci-image
volumes: !reset []
configs: *config-toml
worker:
image: *ci-image
volumes: !reset []
configs: *config-toml
haproxy:
ports: !reset []
volumes: !reset []
configs:
- source: haproxy_cfg
target: /usr/local/etc/haproxy/haproxy.cfg
# наблюдаемость (design change otel-telemetry, решение 20): те же сервисы,
# конфиги — configs; у хранилищ остаётся только именованный volume, у
# Grafana — tmpfs (не volumes) и ни одного порта на хосте
otel-collector:
volumes: !reset []
configs:
- source: otel_collector
target: /etc/otelcol-contrib/config.yaml
prometheus:
volumes: !override
- prometheus_data:/prometheus
configs:
- source: prometheus_yml
target: /etc/prometheus/prometheus.yml
# правила записи и оповещения (design change slo-alerts, решение 3)
- source: prometheus_rules
target: /etc/prometheus/rules.yml
loki:
volumes: !override
- loki_data:/loki
configs:
- source: loki_yaml
target: /etc/loki/loki.yaml
tempo:
volumes: !override
- tempo_data:/var/tempo
configs:
- source: tempo_yaml
target: /etc/tempo/tempo.yaml
grafana:
ports: !reset []
volumes: !reset []
configs:
- source: grafana_datasources
target: /etc/grafana/provisioning/datasources/datasources.yaml
- source: grafana_dashboards
target: /etc/grafana/provisioning/dashboards/dashboards.yaml
- source: grafana_dashboard_overview
target: /etc/grafana/dashboards/messenger-overview.json
# файлы по умолчанию 0444 и root: непривилегированные пользователи
# контейнеров читают, но не меняют — как read_only у bind mount
configs:
config_toml:
environment: CI_CONFIG_TOML
valkey_conf:
environment: CI_VALKEY_CONF
s3_bootstrap:
environment: CI_S3_BOOTSTRAP
rabbitmq_conf:
environment: CI_RABBITMQ_CONF
haproxy_cfg:
environment: CI_HAPROXY_CFG
otel_collector:
environment: CI_OTEL_COLLECTOR
prometheus_yml:
environment: CI_PROMETHEUS_YML
prometheus_rules:
environment: CI_PROMETHEUS_RULES
loki_yaml:
environment: CI_LOKI_YAML
tempo_yaml:
environment: CI_TEMPO_YAML
grafana_datasources:
environment: CI_GRAFANA_DATASOURCES
grafana_dashboards:
environment: CI_GRAFANA_DASHBOARDS
grafana_dashboard_overview:
environment: CI_GRAFANA_DASHBOARD_OVERVIEW