docs(stage): how to expose stage externally — DNS + cerbot vs proxmox port

Stage deploy lands the api+web containers fine (last deploy succeeded), but
external 8080/8081 are blocked at the Proxmox/provider firewall (verified:
ufw on the VM is inactive, so the block is upstream).

Added /etc/nginx/conf.d/food-market-stage.conf on the server: vhost on
port 80 (which IS open) for server_name food-market-stage.space-time.kz
proxying to 127.0.0.1:8081. Once a DNS A-record is added, certbot can
issue Let's Encrypt — same pattern the existing food-market-server uses.

docs/stage-access.md — runbook with the three options (DNS subdomain,
open Proxmox port, SSH tunnel for quick test).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
nurdotnet 2026-04-22 20:14:00 +05:00
parent 1c108b88a4
commit 3b9cf0ee9a

59
docs/stage-access.md Normal file
View file

@ -0,0 +1,59 @@
# Доступ к stage food-market.space-time.kz
## Текущая ситуация
- **Stage запущен** на `88.204.171.93` через docker compose в `~/food-market-stage/deploy/`
- **Порты внутри:** API 8080, Web 8081, Postgres 5434 (localhost)
- **Внешний доступ к 8080/8081 заблокирован** на уровне Proxmox/провайдера
- **Открыты снаружи:** 80, 443 (для существующих сайтов через nginx)
## Что уже настроено
В `/etc/nginx/conf.d/food-market-stage.conf` добавлен vhost:
```
server {
listen 80;
server_name food-market-stage.space-time.kz;
location / { proxy_pass http://127.0.0.1:8081; ... }
}
```
## Что нужно сделать (одноразово)
### 1. Поднять DNS A-запись
В DNS-провайдере зоны `space-time.kz` (Cloudflare?) добавить:
```
food-market-stage.space-time.kz A 88.204.171.93 TTL 300
```
### 2. Выпустить SSL через certbot
После того как DNS прописан и распространился (5-10 мин):
```bash
ssh -p 9393 nns@88.204.171.93 'sudo certbot --nginx -d food-market-stage.space-time.kz --non-interactive --agree-tos -m admin@space-time.kz'
```
После этого: https://food-market-stage.space-time.kz — рабочая stage-админка.
## Альтернатива — открыть порт в Proxmox
Если не хочется заводить subdomain, можно просто открыть `8081` в Proxmox firewall:
- Проверить: что-то типа Datacenter → Firewall → Add Rule (если firewall на уровне DC)
- Или Node → Firewall → Add Rule (если на уровне VM)
- Action: Accept, Direction: in, Protocol: tcp, Dest port: 8081
Тогда работать будет на http://88.204.171.93:8081 (но без HTTPS).
## Тест без DNS — SSH-туннель
С Mac/iPhone (через Termius):
```bash
ssh -L 8081:localhost:8081 -p 9393 nns@88.204.171.93
```
Открыть в браузере http://localhost:8081 — пойдёт через тоннель.
## Когда запустится Claude на сервере
Я завершу всю эту настройку (включая DNS если ты дашь доступ к Cloudflare) и пришлю Telegram «Stage live: https://...».