fix: быстрое развёртывание — PGDG, /opt/shop/shop10, без placeholder URL
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+12
-24
@@ -26,38 +26,26 @@ node -v # v20.x
|
||||
|
||||
### PostgreSQL 17
|
||||
|
||||
```bash
|
||||
apt install -y postgresql-17 postgresql-client-17
|
||||
systemctl enable postgresql
|
||||
systemctl start postgresql
|
||||
pg_isready -h 127.0.0.1 -p 5432
|
||||
```
|
||||
|
||||
Если пакет `postgresql-17` не найден — [репозиторий PGDG](https://www.postgresql.org/download/linux/ubuntu/):
|
||||
Не используйте `apt install postgresql-17` без PGDG — пакет не найдётся. Скрипт подключает PGDG автоматически:
|
||||
|
||||
```bash
|
||||
apt install -y curl ca-certificates
|
||||
install -d /usr/share/postgresql-common/pgdg
|
||||
curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail \
|
||||
https://www.postgresql.org/media/keys/ACCC4CF8.asc
|
||||
sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(. /etc/os-release && echo ${VERSION_CODENAME}-pgdg) main" > /etc/apt/sources.list.d/pgdg.list'
|
||||
apt update
|
||||
apt install -y postgresql-17 postgresql-client-17
|
||||
sudo bash /opt/shop/shop10/scripts/install-postgresql-ubuntu.sh
|
||||
```
|
||||
|
||||
## 3. Клонирование проекта
|
||||
|
||||
```bash
|
||||
cd /opt
|
||||
git clone https://git.evilfox.cc/test/shop10.git shop
|
||||
cd shop
|
||||
git checkout v0.10.0
|
||||
git clone https://git.evilfox.cc/test/shop10.git /opt/shop/shop10
|
||||
cd /opt/shop/shop10/shop10
|
||||
git checkout v0.20.0
|
||||
```
|
||||
|
||||
Или быстрая установка всего стека: `sudo bash scripts/quick-deploy-ubuntu.sh`
|
||||
|
||||
## 4. База данных PostgreSQL
|
||||
|
||||
```bash
|
||||
cd /opt/shop
|
||||
cd /opt/shop/shop10/shop10
|
||||
bash scripts/setup-postgres-ubuntu.sh
|
||||
```
|
||||
|
||||
@@ -101,7 +89,7 @@ openssl rand -hex 32
|
||||
## 6. Установка зависимостей Node.js
|
||||
|
||||
```bash
|
||||
cd /opt/shop
|
||||
cd /opt/shop/shop10
|
||||
npm install --omit=dev
|
||||
```
|
||||
|
||||
@@ -110,7 +98,7 @@ npm install --omit=dev
|
||||
## 7. Служба systemd
|
||||
|
||||
```bash
|
||||
cp /opt/shop/deploy/shop.service /etc/systemd/system/shop.service
|
||||
cp /opt/shop/shop10/deploy/shop.service /etc/systemd/system/shop.service
|
||||
systemctl daemon-reload
|
||||
systemctl enable shop
|
||||
systemctl start shop
|
||||
@@ -152,7 +140,7 @@ apt update && apt install -y caddy
|
||||
Конфигурация:
|
||||
|
||||
```bash
|
||||
cp /opt/shop/caddy/Caddyfile.example /etc/caddy/Caddyfile
|
||||
cp /opt/shop/shop10/caddy/Caddyfile.example /etc/caddy/Caddyfile
|
||||
nano /etc/caddy/Caddyfile
|
||||
```
|
||||
|
||||
@@ -195,7 +183,7 @@ systemctl daemon-reload
|
||||
## 10. Обновление
|
||||
|
||||
```bash
|
||||
cd /opt/shop/shop10
|
||||
cd /opt/shop/shop10/shop10
|
||||
git config --global --add safe.directory "$(pwd)"
|
||||
bash scripts/server-update.sh
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user