-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
100 lines (91 loc) · 2.63 KB
/
docker-compose.yml
File metadata and controls
100 lines (91 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# =========================================
# TelePlay - Docker Compose
# =========================================
#
# Usage:
# 1. Copy .env.example to .env and fill in your values
# 2. Run: docker-compose up -d
#
# Services:
# - db: PostgreSQL database
# - backend: FastAPI + Telegram Bot
# - web: React web interface (nginx)
#
# =========================================
services:
# -----------------------------------------
# PostgreSQL Database
# -----------------------------------------
db:
image: postgres:15-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-telegram_tv}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
networks:
- telegram-tv-network
# -----------------------------------------
# Backend API + Telegram Bot
# -----------------------------------------
backend:
build: ./backend
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
# Database
DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@db:5432/${POSTGRES_DB:-telegram_tv}
# Redis (Optional - Currently unused)
# REDIS_URL: redis://redis:6379
# Telegram (from .env file)
TELEGRAM_API_ID: ${TELEGRAM_API_ID}
TELEGRAM_API_HASH: ${TELEGRAM_API_HASH}
TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN}
TELEGRAM_STORAGE_CHANNEL_ID: ${TELEGRAM_STORAGE_CHANNEL_ID}
# Security
JWT_SECRET: ${JWT_SECRET:-change-me-in-production}
JWT_EXPIRY_MINUTES: ${JWT_EXPIRY_MINUTES:-10080}
# Web URL
WEB_BASE_URL: ${WEB_BASE_URL:-http://localhost}
ports:
- "${BACKEND_PORT:-8000}:8000"
volumes:
# Persist Telegram session
- telegram_session:/app
networks:
- telegram-tv-network
# -----------------------------------------
# Web Interface (React + Nginx)
# -----------------------------------------
web:
build: ./web
restart: unless-stopped
depends_on:
- backend
ports:
- "${WEB_PORT:-80}:80"
networks:
- telegram-tv-network
# -----------------------------------------
# Volumes
# -----------------------------------------
volumes:
postgres_data:
driver: local
telegram_session:
driver: local
# -----------------------------------------
# Networks
# -----------------------------------------
networks:
telegram-tv-network:
driver: bridge