86 lines
2.1 KiB
YAML
86 lines
2.1 KiB
YAML
version: '3.8'
|
|
|
|
networks:
|
|
production:
|
|
external: false
|
|
|
|
volumes:
|
|
portainer_data:
|
|
driver: local
|
|
bot_data:
|
|
driver: local
|
|
|
|
services:
|
|
# Portainer для управления контейнерами
|
|
portainer:
|
|
image: portainer/portainer-ce:latest
|
|
container_name: portainer
|
|
command: -H unix:///var/run/docker.sock
|
|
environment:
|
|
- PORTAINER_HTTP_PORT=9000
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- portainer_data:/data
|
|
ports:
|
|
- "9000:9000"
|
|
networks:
|
|
- production
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--spider", "-q", "http://localhost:9000"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# MikroTik Telegram Bot
|
|
mikrotik-bot:
|
|
image: 10.10.0.20:5000/mikrotik-bot:latest
|
|
container_name: mikrotik-telegram-bot
|
|
env_file:
|
|
- bot.env
|
|
volumes:
|
|
- bot_data:/app/data
|
|
networks:
|
|
- production
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 15s
|
|
labels:
|
|
- "com.centurylinklabs.watchtower.enable=true"
|
|
- "io.portainer.accesscontrol.teams.mikrotik-bot"
|
|
|
|
# Watchtower для автообновления бота
|
|
watchtower:
|
|
image: containrrr/watchtower:latest
|
|
container_name: watchtower-production
|
|
environment:
|
|
- WATCHTOWER_CLEANUP=true
|
|
- WATCHTOWER_POLL_INTERVAL=60 # каждую минуту для быстрого тестирования
|
|
- WATCHTOWER_INCLUDE_STOPPED=true
|
|
- WATCHTOWER_REVIVE_STOPPED=true
|
|
- WATCHTOWER_LABEL_ENABLE=true
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
networks:
|
|
- production
|
|
restart: unless-stopped
|
|
|
|
# Nginx для reverse proxy (опционально)
|
|
nginx:
|
|
image: nginx:alpine
|
|
container_name: nginx-proxy
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
networks:
|
|
- production
|
|
depends_on:
|
|
- portainer
|
|
- mikrotik-bot
|
|
restart: unless-stopped |