Skip to content

Commit bcdd80d

Browse files
committed
chore: setup log retention, promtail pipelines and infra updates
1 parent 1a85292 commit bcdd80d

File tree

5 files changed

+25
-7
lines changed

5 files changed

+25
-7
lines changed

infra/docker-compose.prod.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ services:
1313
- REDIS_HOST=redis
1414
- QDRANT_HOST=qdrant
1515
- START_METRICS=false
16+
ports:
17+
- "8001:8001"
1618
depends_on:
1719
postgres:
1820
condition: service_healthy

infra/monitoring/loki/loki-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ common:
1616
kvstore:
1717
store: inmemory
1818

19+
ingester:
20+
lifecycler:
21+
address: 127.0.0.1
22+
ring:
23+
kvstore:
24+
store: inmemory
25+
replication_factor: 1
26+
1927
schema_config:
2028
configs:
2129
- from: 2020-10-24

infra/monitoring/promtail-config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ scrape_configs:
1414
- host: unix:///var/run/docker.sock
1515
refresh_interval: 5s
1616
relabel_configs:
17+
# Keep only serotonin_script containers
18+
- source_labels: ["__meta_docker_container_name"]
19+
regex: "/serotonin_script-.*"
20+
action: keep
1721
- source_labels: ["__meta_docker_container_name"]
1822
regex: "/(.*)"
1923
target_label: "container"
2024
- source_labels: ["__meta_docker_container_log_stream"]
2125
target_label: "stream"
22-
# Drop containers without a name (system containers)
23-
- source_labels: ["container"]
24-
regex: ".+"
25-
action: keep

scripts/deploy.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/bin/bash
21
set -e
32

43
echo "🚀 Starting Production Deployment..."
@@ -9,7 +8,7 @@ docker compose -f docker-compose.yml -f infra/docker-compose.prod.yml down --rem
98

109
# 2. Збірка нових образів
1110
echo "📦 Building images..."
12-
docker compose -f docker-compose.yml -f infra/docker-compose.prod.yml build
11+
docker compose -f docker-compose.yml -f infra/docker-compose.prod.yml up -d --build
1312

1413
# 3. Запуск бази даних та перевірка здоров'я
1514
echo "🗄️ Starting Database..."

scripts/setup.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
# scripts/setup.sh
1+
set -e
2+
3+
echo "Waiting for postgres at ${POSTGRES_HOST}:${POSTGRES_PORT}..."
4+
until nc -z "${POSTGRES_HOST}" "${POSTGRES_PORT}"; do
5+
echo "Postgres is unavailable - retrying in 1s"
6+
sleep 1
7+
done
8+
9+
echo "Postgres is up - running migrations"
10+
alembic upgrade head

0 commit comments

Comments
 (0)