Files
telegram-shop/docker-compose.yml
Z User de6f82bd00 feat: add Docker deployment (Dockerfile, docker-compose, .dockerignore) and update docs
- Multi-stage Dockerfile (node:22-slim, bun build, standalone output, non-root)
- docker-compose.yml with DB volume, healthcheck, memory limits
- .dockerignore to exclude dev artifacts from build context
- docs: full deployment guide with docker compose, manual docker, env vars,
  reverse proxy configs (Caddy/Nginx), update instructions, server requirements
- docs: comparison table old (Node.js bot) vs new (Next.js admin)
2026-08-05 23:27:35 +00:00

33 lines
1.0 KiB
YAML

services:
admin:
build:
context: .
dockerfile: ./Dockerfile
container_name: tg_shop_admin
restart: always
ports:
- "3000:3000"
environment:
# === Обязательные ===
- DATABASE_URL=file:/app/db/custom.db
- ADMIN_SECRET=${ADMIN_SECRET:-changeme}
- SUPER_ADMIN_SECRET=${SUPER_ADMIN_SECRET:-changeme_super}
# === ИИ-чатбот (опционально) ===
- CHATBOT_API_KEY=${CHATBOT_API_KEY:-}
- CHATBOT_API_ENDPOINT=${CHATBOT_API_ENDPOINT:-https://api.openai.com/v1}
volumes:
# Персистентная база данных
- ./db:/app/db
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 256M
healthcheck:
test: ["CMD", "node", "-e", "const http = require('http'); http.get('http://localhost:3000/api/auth/session', r => { process.exit(r.statusCode === 401 ? 0 : 1) }).on('error', () => process.exit(1))"]
interval: 30s
timeout: 10s
retries: 3
start_period: 15s