-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
69 lines (64 loc) · 2.27 KB
/
docker-compose.yml
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
services:
db:
image: postgres:17.0
container_name: wg_tg_bot-db
restart: always
env_file:
- ./.env
ports:
- "5432:5432"
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- pgdata:/var/lib/postgresql/data # Для сохранения данных базы между перезапусками
redis:
image: redis:7.4
restart: always
ports:
- "6379:6379"
bot:
build:
context: .
dockerfile: Dockerfile # Укажи имя Dockerfile, если оно отличается
image: ibekirov/wg_tg_bot:local # Локальный тег для отличия
# image: ibekirov/wg_tg_bot:v1.4
restart: always
platform: linux/amd64
expose:
- "443" # Поменяли ports на expose, так как Nginx будет проксировать
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
REDIS_URL: redis://redis:6379/0
HOST: "wgbot.ru" # Указываем домен для Rails
# RAILS_MASTER_KEY: "<your_master_key>" # Укажи значение из config/master.key
env_file:
- ./.env.production
# volumes:
# - .:/rails
depends_on:
- db
- redis
nginx:
image: nginx:latest
restart: always
ports:
- "80:80" # Для Certbot и редиректа HTTP -> HTTPS
- "443:443" # Для HTTPS
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf # Конфигурация Nginx
- certbot-data:/etc/letsencrypt # Сертификаты Let's Encrypt
- ./certbot/www:/var/www/certbot # Для проверки Certbot
depends_on:
- bot
certbot:
image: certbot/certbot
volumes:
- certbot-data:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
# command: certonly --webroot --webroot-path=/var/www/certbot --email [email protected] --agree-tos --no-eff-email -d wgbot.ru -d www.wgbot.ru
command: certonly --manual --preferred-challenges dns --email [email protected] --agree-tos --no-eff-email -d wgbot.ru -d www.wgbot.ru
depends_on:
- nginx
volumes:
pgdata: # Том для данных PostgreSQL
certbot-data: # Том для сертификатов Let's Encrypt