Files
framework-ignition-docker/docker/docker-compose.yml
2026-03-17 09:10:25 -05:00

119 lines
3.1 KiB
YAML

x-default-logging: &default-logging
logging:
driver: json-file
options:
max-size: "100m"
max-file: "5"
x-ignition-opts: &ignition-opts
<<: *default-logging
build:
context: .
args:
IGNITION_VERSION: ${IGNITION_VERSION:-8.3.3}
dockerfile: ./gw-build/Dockerfile
image: framework-ignition:${IGNITION_VERSION:-8.3.3}
env_file: gw-init/gateway.env
secrets:
- gateway-admin-password
name: framework
services:
ignition:
<<: *ignition-opts
container_name: ignition
pull_policy: missing
depends_on:
traefik:
condition: service_healthy
postgres:
condition: service_healthy
command: >
-n ${GATEWAY_NAME:-framework} -m ${GATEWAY_MAX_MEMORY:-1024}
ports:
- "8088:8088"
- "8043:8043"
- "62541:62541"
- "1883:1883"
volumes:
- ignition-data:/usr/local/bin/ignition/data
- ./gw-config:/usr/local/bin/ignition/data/config:rw
- ./gw-commission/commissioning.json:/usr/local/bin/ignition/data/commissioning.json:ro
- ../ignition/project:/usr/local/bin/ignition/data/projects/framework:rw
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8088/StatusPing"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
labels:
- "traefik.enable=true"
- "traefik.http.routers.ignition.entrypoints=web"
- "traefik.http.routers.ignition.rule=Host(`${GATEWAY_HOSTNAME:-ignition.localhost}`)"
- "traefik.http.services.ignition.loadbalancer.server.port=8088"
networks:
- proxy
restart: unless-stopped
postgres:
<<: *default-logging
image: postgres:16-alpine
container_name: postgres
volumes:
- postgres-data:/var/lib/postgresql/data
- ./config/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
environment:
POSTGRES_DB: ignition
POSTGRES_USER: ignition
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ignition"]
interval: 10s
timeout: 5s
retries: 5
networks:
- proxy
restart: unless-stopped
traefik:
<<: *default-logging
image: traefik:v3
container_name: traefik
ports:
- "80:80"
- "443:443"
- "8080:8080"
command:
- --configFile=/etc/traefik/traefik.yml
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./config/traefik/traefik.yml:/etc/traefik/traefik.yml:ro
- ./config/traefik/dynamic:/etc/traefik/dynamic:ro
healthcheck:
test: ["CMD", "traefik", "healthcheck", "--ping"]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.entrypoints=web"
- "traefik.http.routers.traefik.rule=Host(`traefik.localhost`)"
- "traefik.http.routers.traefik.service=api@internal"
networks:
- proxy
restart: unless-stopped
networks:
proxy:
name: proxy
secrets:
gateway-admin-password:
file: gw-secret/GATEWAY_ADMIN_PASSWORD
volumes:
ignition-data:
postgres-data: