mirror of
https://github.com/mayanayza/netvisor.git
synced 2025-12-10 08:24:08 -06:00
120 lines
3.0 KiB
YAML
120 lines
3.0 KiB
YAML
services:
|
|
postgres-dev:
|
|
image: postgres:17-alpine
|
|
environment:
|
|
POSTGRES_DB: netvisor
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "5435:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
netvisor-dev:
|
|
ipv4_address: 172.25.0.6
|
|
|
|
server:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile.dev
|
|
command: sh -c "cargo run --bin server"
|
|
ports:
|
|
- "60072:60072"
|
|
environment:
|
|
- RUST_LOG=debug,sqlx=off,tower_http=off
|
|
- NETVISOR_PUBLIC_URL=http://localhost:60072
|
|
- NETVISOR_DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD:-password}@postgres-dev:5432/netvisor
|
|
- NETVISOR_WEB_EXTERNAL_PATH=/app/static
|
|
- NETVISOR_LOG_LEVEL=debug
|
|
- NETVISOR_INTEGRATED_DAEMON_URL=http://daemon:60073
|
|
volumes:
|
|
- ./backend:/app
|
|
- data-volume:/data
|
|
- ui-build:/app/static:ro
|
|
- cargo-cache:/usr/local/cargo/registry
|
|
- cargo-git:/usr/local/cargo/git
|
|
- rust-target:/app/target
|
|
depends_on:
|
|
postgres-dev:
|
|
condition: service_healthy
|
|
daemon:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:60072/api/health"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 10
|
|
start_period: 600s
|
|
networks:
|
|
netvisor-dev:
|
|
ipv4_address: 172.25.0.3
|
|
|
|
daemon:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile.dev
|
|
privileged: true
|
|
restart: unless-stopped
|
|
environment:
|
|
- NETVISOR_SERVER_URL=http://server:60072
|
|
- NETVISOR_DAEMON_PORT=60073
|
|
- NETVISOR_BIND_ADDRESS=0.0.0.0
|
|
- NETVISOR_NAME=netvisor-daemon
|
|
- NETVISOR_MODE=Push
|
|
- NETVISOR_LOG_LEVEL=debug
|
|
- NETVISOR_HEARTBEAT_INTERVAL=30
|
|
volumes:
|
|
- ./backend:/app
|
|
- ./data/daemon_config:/root/.config/netvisor/daemon
|
|
- cargo-cache:/usr/local/cargo/registry
|
|
- cargo-git:/usr/local/cargo/git
|
|
- rust-target:/app/target
|
|
command: sh -c "cargo run --bin daemon"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -f http://localhost:60073/api/health || exit 1"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 15
|
|
start_period: 600s
|
|
networks:
|
|
netvisor-dev:
|
|
ipv4_address: 172.25.0.4
|
|
|
|
homeassistant:
|
|
image: lscr.io/linuxserver/homeassistant:latest
|
|
container_name: homeassistant-discovery
|
|
environment:
|
|
- PUID=1000
|
|
- PGID=1000
|
|
- TZ=America/New_York
|
|
volumes:
|
|
- homeassistant-config:/config
|
|
ports:
|
|
- 8123:8123
|
|
restart: unless-stopped
|
|
networks:
|
|
netvisor-dev:
|
|
ipv4_address: 172.25.0.5
|
|
|
|
volumes:
|
|
ui-build:
|
|
cargo-cache:
|
|
cargo-git:
|
|
rust-target:
|
|
data-volume:
|
|
daemon-config-volume:
|
|
postgres_data:
|
|
homeassistant-config:
|
|
|
|
networks:
|
|
netvisor-dev:
|
|
driver: bridge
|
|
ipam:
|
|
config:
|
|
- subnet: 172.25.0.0/28
|
|
gateway: 172.25.0.1 |