63 lines
2.5 KiB
YAML
63 lines
2.5 KiB
YAML
# ----------------------------------------------------------------------------
|
|
# Art IoT production stack — one service, deployed by Komodo, panel routed
|
|
# through Traefik.
|
|
#
|
|
# Two front doors, same container port:
|
|
# * ws://<docker-host>:9000/<ChargerID> — the charger dials this DIRECTLY
|
|
# (published port below). The URL is hardcoded in the charger's touch-
|
|
# screen and changing it needs a power-cycle, so the Docker host must be
|
|
# reachable at that exact IP:port (DHCP reservation!). No TLS — the
|
|
# JC-6620 speaks plain ws://.
|
|
# * https://${ARTIOT_HOST} — the human-facing panel via Traefik.
|
|
#
|
|
# Komodo env (all optional, defaults below):
|
|
# ARTIOT_TAG image tag — `main` for rolling, a commit SHA to pin
|
|
# ARTIOT_HOST panel hostname routed by Traefik
|
|
# TRAEFIK_NETWORK name of the external Traefik docker network
|
|
# ARTIOT_ENTRYPOINT Traefik entrypoint (default websecure)
|
|
# ARTIOT_CERTRESOLVER Traefik cert resolver (default letsencrypt)
|
|
#
|
|
# First deploy on a new host: copy the existing backend.db into the volume —
|
|
# docker compose cp ./backend/backend.db artiot:/data/backend.db (then restart)
|
|
# or bootstrap fresh: docker compose exec artiot python -m backend.users add <name> --scopes admin
|
|
#
|
|
# The relays are controlled over the LAN (tinytuya, TCP to the device IPs) —
|
|
# the Docker host must sit on a subnet that reaches them.
|
|
# ----------------------------------------------------------------------------
|
|
|
|
services:
|
|
artiot:
|
|
image: ${ARTIOT_REGISTRY:-git.infra.msai.al/art/charging_station}:${ARTIOT_TAG:-main}
|
|
container_name: artiot
|
|
restart: unless-stopped
|
|
ports:
|
|
# OCPP — the charger's hardcoded dial-in. Keep 9000:9000, always.
|
|
- "9000:9000"
|
|
volumes:
|
|
# backend.db + events.jsonl; survives `docker compose down`, only
|
|
# `down -v` wipes it.
|
|
- artiot-data:/data
|
|
networks:
|
|
- traefik-net
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-fsS", "http://localhost:9000/api/health"]
|
|
interval: 15s
|
|
timeout: 3s
|
|
retries: 5
|
|
start_period: 10s
|
|
labels:
|
|
- traefik.enable=true
|
|
- traefik.http.routers.artiot.rule=Host(`${ARTIOT_HOST:-artiot.infra.msai.al}`)
|
|
- traefik.http.routers.artiot.entrypoints=${ARTIOT_ENTRYPOINT:-websecure}
|
|
- "traefik.http.routers.artiot.tls.certresolver=acme"
|
|
- traefik.http.services.artiot.loadbalancer.server.port=9000
|
|
|
|
volumes:
|
|
artiot-data:
|
|
name: artiot-data
|
|
|
|
networks:
|
|
traefik-net:
|
|
external: true
|
|
name: ${TRAEFIK_NETWORK:-traefik}
|