126 lines
3.4 KiB
YAML
126 lines
3.4 KiB
YAML
version: "2.4"
|
|
|
|
services:
|
|
redis:
|
|
image: ${REDIS_BASE_IMAGE:-redis:7-alpine}
|
|
container_name: truckwash-redis
|
|
restart: unless-stopped
|
|
command: ["redis-server", "--appendonly", "yes"]
|
|
volumes:
|
|
- ./runtime/redis:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
mariadb:
|
|
image: ${MARIADB_BASE_IMAGE:-mariadb:11}
|
|
container_name: truckwash-mariadb
|
|
restart: unless-stopped
|
|
environment:
|
|
MARIADB_DATABASE: truckwash_edge
|
|
MARIADB_USER: truckwash_edge
|
|
MARIADB_PASSWORD: truckwash_edge
|
|
MARIADB_ROOT_PASSWORD: truckwash_edge_root
|
|
volumes:
|
|
- ./runtime/mariadb:/var/lib/mysql
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -uroot -ptruckwash_edge_root --silent"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 10
|
|
|
|
minio:
|
|
image: ${MINIO_BASE_IMAGE:-minio/minio:latest}
|
|
container_name: truckwash-minio
|
|
restart: unless-stopped
|
|
command: server /data --console-address ":9001"
|
|
environment:
|
|
MINIO_ROOT_USER: truckwashminio
|
|
MINIO_ROOT_PASSWORD: truckwash_edge_storage
|
|
volumes:
|
|
- ./runtime/minio:/data
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:9000/minio/health/live"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
lan-worker:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.lan-worker
|
|
args:
|
|
BASE_IMAGE: ${LAN_WORKER_BASE_IMAGE:-php:8.2-cli-bookworm}
|
|
container_name: truckwash-lan-worker
|
|
restart: unless-stopped
|
|
ports:
|
|
- "127.0.0.1:8090:8090"
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
mariadb:
|
|
condition: service_healthy
|
|
minio:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ./runtime:/opt/truckwash-edge-agent/runtime
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:8090/health"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
edge-agent:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.edge-agent
|
|
args:
|
|
BASE_IMAGE: ${EDGE_AGENT_BASE_IMAGE:-php:8.2-cli-bookworm}
|
|
container_name: truckwash-edge-agent
|
|
restart: unless-stopped
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
mariadb:
|
|
condition: service_healthy
|
|
minio:
|
|
condition: service_healthy
|
|
lan-worker:
|
|
condition: service_healthy
|
|
volumes:
|
|
- ./config.json:/config/config.json
|
|
- ./runtime:/opt/truckwash-edge-agent/runtime
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "test -f /opt/truckwash-edge-agent/runtime/last-heartbeat-ok.txt"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
auto-updater:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.auto-updater
|
|
args:
|
|
BASE_IMAGE: ${AUTO_UPDATER_BASE_IMAGE:-php:8.2-cli-bookworm}
|
|
container_name: truckwash-auto-updater
|
|
restart: unless-stopped
|
|
depends_on:
|
|
edge-agent:
|
|
condition: service_started
|
|
environment:
|
|
AUTO_UPDATER_INTERVAL_SECONDS: 30
|
|
volumes:
|
|
- .:/opt/truckwash-edge-agent
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD-SHELL",
|
|
"php -r '$path=\"/opt/truckwash-edge-agent/runtime/auto-updater-heartbeat.json\"; if (!is_file($path)) { exit(1); } exit((time() - filemtime($path)) <= 90 ? 0 : 1);'",
|
|
]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|