feat(deploy): Docker image + Komodo compose stack + Gitea CI pipeline
- Dockerfile: node:24-alpine builds frontend/dist, python:3.13-slim runs backend.main as uid 1000 under tini; state on /data via env overrides - compose.yaml: raw 9000:9000 for the charger's hardcoded ws:// dial-in, Traefik labels for the panel, everything Komodo-tunable (ARTIOT_TAG/HOST, TRAEFIK_NETWORK, entrypoint, certresolver), curl healthcheck - .gitea/workflows/build.yml: build -> 65-check smoke gate in the image -> push :main + :sha to git.infra.msai.al/art/charging_station -> HMAC-signed Komodo stack redeploy (polymarket-bot pattern; same secret names)
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
# ----------------------------------------------------------------------------
|
||||
# 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=${ARTIOT_CERTRESOLVER:-letsencrypt}
|
||||
- traefik.http.services.artiot.loadbalancer.server.port=9000
|
||||
|
||||
volumes:
|
||||
artiot-data:
|
||||
name: artiot-data
|
||||
|
||||
networks:
|
||||
traefik-net:
|
||||
external: true
|
||||
name: ${TRAEFIK_NETWORK:-traefik}
|
||||
Reference in New Issue
Block a user