108 lines
2.3 KiB
YAML
108 lines
2.3 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
|
|
postgres_db:
|
|
image: postgres:17
|
|
container_name: postgres_db
|
|
env_file: .env
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
environment:
|
|
POSTGRES_DB: ${POSTGRES_DB}
|
|
POSTGRES_USER: ${POSTGRES_USER}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
networks:
|
|
- web_db_network
|
|
- pgadmin_network
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
|
|
pgadmin:
|
|
image: dpage/pgadmin4
|
|
container_name: pgadmin
|
|
env_file: .env
|
|
depends_on:
|
|
postgres_db:
|
|
condition: service_healthy
|
|
ports:
|
|
- "8080:80"
|
|
environment:
|
|
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
|
|
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
|
|
networks:
|
|
- pgadmin_network
|
|
volumes:
|
|
- pgadmin:/var/lib/pgadmin
|
|
restart: unless-stopped
|
|
|
|
zabbix-agent:
|
|
image: zabbix/zabbix-agent:latest
|
|
container_name: zabbix_agent
|
|
env_file: .env
|
|
environment:
|
|
ZBX_SERVER_HOST: ${ZBX_SERVER_HOST}
|
|
volumes:
|
|
- /proc:/host/proc
|
|
- /sys:/host/sys
|
|
- /etc:/host/etc
|
|
privileged: true
|
|
networks:
|
|
- zabbix_network
|
|
|
|
web:
|
|
build: .
|
|
container_name: django_app
|
|
env_file: .env
|
|
restart: unless-stopped
|
|
volumes:
|
|
- .:/app
|
|
- static_volume:/app/smartsoltech/staticfiles
|
|
- media_volume:/app/smartsoltech/media
|
|
ports:
|
|
- "8000:8000"
|
|
depends_on:
|
|
postgres_db:
|
|
condition: service_healthy
|
|
networks:
|
|
- web_db_network
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000').read()"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
bot:
|
|
build: .
|
|
container_name: telegram_bot
|
|
command: sh -c "./wait-for-it.sh postgres_db:5432 -- python smartsoltech/manage.py start_telegram_bot"
|
|
restart: unless-stopped
|
|
volumes:
|
|
- .:/app
|
|
env_file:
|
|
- .env
|
|
depends_on:
|
|
web:
|
|
condition: service_healthy
|
|
networks:
|
|
- web_db_network
|
|
|
|
|
|
volumes:
|
|
pgdata:
|
|
pgadmin:
|
|
static_volume:
|
|
media_volume:
|
|
|
|
networks:
|
|
web_db_network:
|
|
pgadmin_network:
|
|
zabbix_network:
|