Files
telepost/docker-compose.yml
2026-01-18 21:01:43 +03:00

74 lines
1.6 KiB
YAML

version: '3.8'
services:
postgres:
image: postgres:15
container_name: telepost_postgres
environment:
POSTGRES_DB: telepost
POSTGRES_USER: user
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d telepost"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: telepost_redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: telepost_backend
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "8000:8000"
environment:
DATABASE_URL: postgresql://user:password@postgres:5432/telepost
REDIS_URL: redis://redis:6379
SECRET_KEY: your-secret-key-here
ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: 30
TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN}
TELEGRAM_BOT_NAME: ${TELEGRAM_BOT_NAME}
volumes:
- ./backend:/app
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: telepost_frontend
depends_on:
- backend
ports:
- "3000:3000"
environment:
VITE_API_BASE_URL: http://localhost:8000
volumes:
- ./frontend:/app
- /app/node_modules
volumes:
postgres_data:
redis_data: