Refactor environment configuration and update Docker Compose settings
This commit is contained in:
@@ -20,17 +20,6 @@ Overlay per streaming tennis (OBS) con controller remoto via WebSocket.
|
||||
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
# Clona / entra nel progetto
|
||||
cd tennis-roots
|
||||
|
||||
# Avvia tutto con uno script
|
||||
chmod +x start.sh
|
||||
./start.sh
|
||||
```
|
||||
|
||||
Oppure manualmente:
|
||||
|
||||
```bash
|
||||
cd server
|
||||
npm install
|
||||
@@ -134,46 +123,37 @@ npm run dev # node --watch
|
||||
|
||||
## Deploy su VPS (Docker + Traefik)
|
||||
|
||||
Il progetto include `Dockerfile` e `docker-compose.yml` pronti per il deploy
|
||||
su un'infrastruttura con **Traefik** come reverse proxy.
|
||||
|
||||
### Prerequisiti
|
||||
|
||||
- Docker e Docker Compose installati
|
||||
- Docker e Docker Compose
|
||||
- Rete `traefik-public` già esistente (`docker network create traefik-public`)
|
||||
- Dominio configurato (es. `tennis.ricordatiilatte.it`)
|
||||
|
||||
### Procedura
|
||||
|
||||
```bash
|
||||
# Clona il progetto sulla VPS
|
||||
git clone <url> tennis-roots
|
||||
cd tennis-roots
|
||||
|
||||
# Avvia
|
||||
git clone <url> stream-overlay
|
||||
cd stream-overlay
|
||||
cp .env.example .env
|
||||
# imposta DOMAIN con il tuo dominio
|
||||
docker compose up -d
|
||||
|
||||
# Log
|
||||
docker compose logs -f
|
||||
```
|
||||
|
||||
### Accessi
|
||||
|
||||
| Risorsa | URL |
|
||||
|---------|-----|
|
||||
| Controller | `https://tennis.ricordatiilatte.it/controller/` |
|
||||
| Scoreboard | `https://tennis.ricordatiilatte.it/overlay/scoreboard.html` |
|
||||
| Match Info | `https://tennis.ricordatiilatte.it/overlay/match-info.html` |
|
||||
| Clock | `https://tennis.ricordatiilatte.it/overlay/clock.html` |
|
||||
| Server Ind. | `https://tennis.ricordatiilatte.it/overlay/server-indicator.html` |
|
||||
| API stato | `https://tennis.ricordatiilatte.it/api/state` |
|
||||
| WebSocket | `wss://tennis.ricordatiilatte.it/ws` |
|
||||
| Controller | `https://<tuo-dominio>/controller/` |
|
||||
| Scoreboard | `https://<tuo-dominio>/overlay/scoreboard.html` |
|
||||
| Match Info | `https://<tuo-dominio>/overlay/match-info.html` |
|
||||
| Clock | `https://<tuo-dominio>/overlay/clock.html` |
|
||||
| Server Ind. | `https://<tuo-dominio>/overlay/server-indicator.html` |
|
||||
| API stato | `https://<tuo-dominio>/api/state` |
|
||||
| WebSocket | `wss://<tuo-dominio>/ws` |
|
||||
|
||||
### Note
|
||||
|
||||
- Il server è stateless (stato in memoria). Un restart azzera il match.
|
||||
- Il WebSocket funziona nativamente con Traefik (upgrade HTTP → WS automatico).
|
||||
- Se vuoi un dominio diverso, cambia il valore di `Host(...)` in `docker-compose.yml`.
|
||||
|
||||
## Regole punteggio implementate
|
||||
|
||||
@@ -186,22 +166,21 @@ docker compose logs -f
|
||||
## Struttura file
|
||||
|
||||
```
|
||||
tennis-roots/
|
||||
stream-overlay/
|
||||
├── server/
|
||||
│ ├── package.json
|
||||
│ ├── index.js # Server Express + WebSocket
|
||||
│ └── node_modules/
|
||||
│ ├── Dockerfile
|
||||
│ └── index.js
|
||||
├── overlay/
|
||||
│ ├── common.js # Client WebSocket condiviso
|
||||
│ ├── common.js
|
||||
│ ├── scoreboard.html
|
||||
│ ├── match-info.html
|
||||
│ ├── clock.html
|
||||
│ └── server-indicator.html
|
||||
├── controller/
|
||||
│ └── index.html # Pannello di controllo
|
||||
├── server/
|
||||
│ ├── Dockerfile # Immagine container
|
||||
│ └── ...
|
||||
├── docker-compose.yml # Deploy con Traefik
|
||||
│ └── index.html
|
||||
├── docker-compose.yml
|
||||
├── .env.example
|
||||
├── .gitignore
|
||||
└── README.md
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user