forked from mtusi2026/mtusi2026lab2
157 lines
5.5 KiB
Plaintext
157 lines
5.5 KiB
Plaintext
# 2026-10-16 05:21:34 +0300, commit 65003b6 (+ незакоммиченные изменения)
|
|
|
|
Временный проект `lab2fresh`: отдельные volumes lab2fresh_pgdata/lab2fresh_valkeydata, api на :18090, БД и Valkey без проброса портов. Основной стенд не затрагивается.
|
|
$ down -v (очистка остатков прошлого запуска)
|
|
|
|
[exit 0]
|
|
|
|
$ up -d --wait (пустые volumes)
|
|
Volume lab2fresh_valkeydata Creating
|
|
Network lab2fresh_default Creating
|
|
Volume lab2fresh_valkeydata Creating
|
|
Network lab2fresh_default Creating
|
|
Volume lab2fresh_valkeydata Created
|
|
Volume lab2fresh_valkeydata Created
|
|
Volume lab2fresh_pgdata Creating
|
|
Volume lab2fresh_pgdata Creating
|
|
Volume lab2fresh_pgdata Created
|
|
Volume lab2fresh_pgdata Created
|
|
Network lab2fresh_default Created
|
|
Network lab2fresh_default Created
|
|
Container lab2fresh-cache-1 Creating
|
|
Container lab2fresh-db-1 Creating
|
|
Container lab2fresh-cache-1 Created
|
|
Container lab2fresh-db-1 Created
|
|
Container lab2fresh-api-1 Creating
|
|
Container lab2fresh-api-1 Created
|
|
Container lab2fresh-cache-1 Starting
|
|
Container lab2fresh-db-1 Starting
|
|
Container lab2fresh-cache-1 Started
|
|
Container lab2fresh-db-1 Started
|
|
Container lab2fresh-db-1 Waiting
|
|
Container lab2fresh-cache-1 Waiting
|
|
Container lab2fresh-cache-1 Healthy
|
|
Container lab2fresh-db-1 Healthy
|
|
Container lab2fresh-api-1 Starting
|
|
Container lab2fresh-api-1 Started
|
|
Container lab2fresh-cache-1 Waiting
|
|
Container lab2fresh-api-1 Waiting
|
|
Container lab2fresh-db-1 Waiting
|
|
Container lab2fresh-cache-1 Healthy
|
|
Container lab2fresh-db-1 Healthy
|
|
Container lab2fresh-api-1 Healthy
|
|
[exit 0]
|
|
|
|
$ логи api: миграции на пустой БД
|
|
connecting to db...
|
|
applying migrations...
|
|
applied migration 1 (./migrations/001_init.sql)
|
|
applied migration 2 (./migrations/002_sessions.sql)
|
|
migrations ok
|
|
pg pool ready (8 connections)
|
|
redis pool ready (4 connections)
|
|
session store: redis
|
|
session ttl: 3600s
|
|
listening on 0.0.0.0:8080
|
|
[exit 0]
|
|
|
|
schema_migrations: 1,2
|
|
POST /users на новом стенде: HTTP 201; пользователей в БД: 1
|
|
|
|
$ restart api (повторный запуск миграций)
|
|
Container lab2fresh-api-1 Restarting
|
|
Container lab2fresh-api-1 Started
|
|
[exit 0]
|
|
|
|
$ up -d --wait
|
|
Container lab2fresh-api-1 Running
|
|
Container lab2fresh-db-1 Running
|
|
Container lab2fresh-cache-1 Running
|
|
Container lab2fresh-cache-1 Waiting
|
|
Container lab2fresh-db-1 Waiting
|
|
Container lab2fresh-cache-1 Healthy
|
|
Container lab2fresh-db-1 Healthy
|
|
Container lab2fresh-api-1 Waiting
|
|
Container lab2fresh-db-1 Waiting
|
|
Container lab2fresh-cache-1 Waiting
|
|
Container lab2fresh-api-1 Healthy
|
|
Container lab2fresh-db-1 Healthy
|
|
Container lab2fresh-cache-1 Healthy
|
|
[exit 0]
|
|
|
|
$ логи api после рестарта (--since 2026-10-16T02:21:44Z)
|
|
shutting down
|
|
stopped
|
|
connecting to db...
|
|
applying migrations...
|
|
migrations ok
|
|
pg pool ready (8 connections)
|
|
redis pool ready (4 connections)
|
|
session store: redis
|
|
session ttl: 3600s
|
|
listening on 0.0.0.0:8080
|
|
[exit 0]
|
|
|
|
строк 'applied migration' после рестарта: 0; schema_migrations: 2 строки; пользователей: 1 (данные не дублируются и не теряются)
|
|
|
|
$ down -v (НАМЕРЕННОЕ удаление volumes временного проекта)
|
|
Container lab2fresh-api-1 Stopping
|
|
Container lab2fresh-api-1 Stopped
|
|
Container lab2fresh-api-1 Removing
|
|
Container lab2fresh-api-1 Removed
|
|
Container lab2fresh-db-1 Stopping
|
|
Container lab2fresh-cache-1 Stopping
|
|
Container lab2fresh-cache-1 Stopped
|
|
Container lab2fresh-cache-1 Removing
|
|
Container lab2fresh-cache-1 Removed
|
|
Container lab2fresh-db-1 Stopped
|
|
Container lab2fresh-db-1 Removing
|
|
Container lab2fresh-db-1 Removed
|
|
Volume lab2fresh_valkeydata Removing
|
|
Volume lab2fresh_pgdata Removing
|
|
Network lab2fresh_default Removing
|
|
Volume lab2fresh_valkeydata Removed
|
|
Volume lab2fresh_pgdata Removed
|
|
Network lab2fresh_default Removed
|
|
[exit 0]
|
|
|
|
$ up -d --wait
|
|
Network lab2fresh_default Creating
|
|
Network lab2fresh_default Creating
|
|
Volume lab2fresh_valkeydata Creating
|
|
Volume lab2fresh_valkeydata Creating
|
|
Volume lab2fresh_pgdata Creating
|
|
Volume lab2fresh_pgdata Creating
|
|
Volume lab2fresh_valkeydata Created
|
|
Volume lab2fresh_valkeydata Created
|
|
Volume lab2fresh_pgdata Created
|
|
Volume lab2fresh_pgdata Created
|
|
Network lab2fresh_default Created
|
|
Network lab2fresh_default Created
|
|
Container lab2fresh-db-1 Creating
|
|
Container lab2fresh-cache-1 Creating
|
|
Container lab2fresh-cache-1 Created
|
|
Container lab2fresh-db-1 Created
|
|
Container lab2fresh-api-1 Creating
|
|
Container lab2fresh-api-1 Created
|
|
Container lab2fresh-db-1 Starting
|
|
Container lab2fresh-cache-1 Starting
|
|
Container lab2fresh-db-1 Started
|
|
Container lab2fresh-cache-1 Started
|
|
Container lab2fresh-cache-1 Waiting
|
|
Container lab2fresh-db-1 Waiting
|
|
Container lab2fresh-db-1 Healthy
|
|
Container lab2fresh-cache-1 Healthy
|
|
Container lab2fresh-api-1 Starting
|
|
Container lab2fresh-api-1 Started
|
|
Container lab2fresh-cache-1 Waiting
|
|
Container lab2fresh-api-1 Waiting
|
|
Container lab2fresh-db-1 Waiting
|
|
Container lab2fresh-db-1 Healthy
|
|
Container lab2fresh-cache-1 Healthy
|
|
Container lab2fresh-api-1 Healthy
|
|
[exit 0]
|
|
|
|
после down -v пользователей: 0 — все данные и сессии потеряны, миграции применены заново
|
|
временный проект lab2fresh удалён вместе с volumes
|