-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
98 lines (86 loc) · 2.41 KB
/
Copy pathdocker-compose.yml
File metadata and controls
98 lines (86 loc) · 2.41 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
version: '3.8'
services:
telegram-bot:
build:
context: .
dockerfile: Dockerfile
container_name: second-brain-bot
restart: unless-stopped
# Port mapping
ports:
- "8443:8443"
# Environment variables from .env file
env_file:
- .env
# Or specify environment variables directly
# environment:
# - TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
# - WEBHOOK_URL=${WEBHOOK_URL}
# - WEBHOOK_PORT=8443
# - LOG_LEVEL=INFO
# - GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
# - GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET}
# - GOOGLE_REDIRECT_URI=${GOOGLE_REDIRECT_URI}
# - DATABASE_USER=${DATABASE_USER}
# - DATABASE_PASSWORD=${DATABASE_PASSWORD}
# - DATABASE_HOST=${DATABASE_HOST}
# - DATABASE_PORT=${DATABASE_PORT}
# - DATABASE_NAME=${DATABASE_NAME}
# - TOKEN_ENCRYPTION_KEY=${TOKEN_ENCRYPTION_KEY}
# - DRIVE_FOLDER_NAME=${DRIVE_FOLDER_NAME}
# Volume for persistent token storage (optional if using database)
volumes:
- ./tokens:/app/tokens
# Health check
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8443/')"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# Logging
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Resource limits (adjust based on your needs)
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
reservations:
cpus: '0.25'
memory: 256M
# Network mode (optional)
# network_mode: "bridge"
# Security options
security_opt:
- no-new-privileges:true
# Read-only root filesystem (optional, may need adjustments)
# read_only: true
# tmpfs:
# - /tmp
# Optional: Add database service if not using external database
# services:
# postgres:
# image: postgres:15-alpine
# container_name: second-brain-db
# restart: unless-stopped
# environment:
# POSTGRES_DB: second_brain
# POSTGRES_USER: botuser
# POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
# volumes:
# - postgres-data:/var/lib/postgresql/data
# ports:
# - "5432:5432"
# healthcheck:
# test: ["CMD-SHELL", "pg_isready -U botuser"]
# interval: 10s
# timeout: 5s
# retries: 5
#
# volumes:
# postgres-data: