-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
93 lines (87 loc) · 2.1 KB
/
docker-compose.yml
File metadata and controls
93 lines (87 loc) · 2.1 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
# Hysteria Backend - Docker Compose
# Запуск: docker-compose up -d
services:
# Redis - кэширование
redis:
image: redis:7-alpine
container_name: hysteria-redis
restart: always
command: redis-server --maxmemory 1gb --maxmemory-policy allkeys-lru --save ""
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
start_period: 5s
networks:
- hysteria-net
# MongoDB
mongo:
image: mongo:7
container_name: hysteria-mongo
restart: always
volumes:
- mongo_data:/data/db
environment:
MONGO_INITDB_DATABASE: hysteria
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER:-hysteria}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')", "--quiet"]
interval: 5s
timeout: 5s
retries: 12
start_period: 20s
networks:
- hysteria-net
# Caddy - reverse proxy с автоматическим SSL
caddy:
image: caddy:2-alpine
container_name: hysteria-caddy
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
environment:
- PANEL_DOMAIN=${PANEL_DOMAIN}
- ACME_EMAIL=${ACME_EMAIL}
networks:
- hysteria-net
depends_on:
- backend
# Hysteria Backend
backend:
build: .
container_name: hysteria-backend
restart: always
depends_on:
mongo:
condition: service_healthy
redis:
condition: service_healthy
expose:
- "3000"
volumes:
- ./logs:/app/logs
- ./backups:/app/backups
- caddy_data:/caddy_data:ro
env_file:
- .env
environment:
MONGO_URI: mongodb://${MONGO_USER:-hysteria}:${MONGO_PASSWORD}@mongo:27017/hysteria?authSource=admin
REDIS_URL: redis://redis:6379
PORT: 3000
USE_CADDY: "true"
networks:
- hysteria-net
networks:
hysteria-net:
driver: bridge
volumes:
mongo_data:
caddy_data:
caddy_config: