fix: server deploy setup and env example

This commit is contained in:
orohi
2026-06-17 04:35:48 +03:00
parent 8c21b62a4f
commit f214aaa48b
4 changed files with 51 additions and 5 deletions
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
if [ ! -f .env.example ]; then
echo "Ошибка: .env.example не найден."
echo "Сначала клонируйте репозиторий:"
echo " git clone https://git.evilfox.cc/test2/panelhosting.git /opt/host"
exit 1
fi
if [ ! -f .env ]; then
cp .env.example .env
echo "Создан .env из .env.example"
else
echo ".env уже существует, пропускаем"
fi
docker compose up -d postgres
docker compose --profile migrate run --rm migrate
echo "Готово. PostgreSQL запущен, миграции применены."