Add HAL module structure for deployment as CDN service

Enables deploying f1-circuits as a HAL module on ace behind Traefik,
serving track SVGs at f1-circuits.zurag.be.
This commit is contained in:
2026-05-06 21:31:37 +02:00
parent c94ebcfb22
commit 9faf9f4041
3 changed files with 47 additions and 0 deletions
+14
View File
@@ -0,0 +1,14 @@
manifest: 2
name: f1-circuits
version: "1.0.0"
description: "F1 track layout CDN — serves SVG/PNG circuit maps by grand prix and year"
env:
DOMAIN:
from: node.domain
default: localhost
docker:
- image: f1-circuits
context: .
dockerfile: service/Dockerfile
+13
View File
@@ -0,0 +1,13 @@
FROM python:3.12-slim
WORKDIR /app
RUN pip install --no-cache-dir fastapi uvicorn fastf1 python-slugify
COPY cdn-api.py circuits_service.py ergast_service.py ./
COPY models/ ./models/
COPY circuits/ ./circuits/
EXPOSE 8000
CMD ["uvicorn", "cdn-api:app", "--host", "0.0.0.0", "--port", "8000"]
+20
View File
@@ -0,0 +1,20 @@
services:
f1-circuits:
image: registry-api.novox.be/novox/f1-circuits:latest
container_name: f1-circuits
restart: unless-stopped
volumes:
- ./cache:/app/cache
labels:
traefik.enable: "true"
traefik.http.routers.f1-circuits.rule: "Host(`f1-circuits.${DOMAIN:-localhost}`)"
traefik.http.routers.f1-circuits.entrypoints: websecure
traefik.http.routers.f1-circuits.tls.certresolver: le
traefik.http.services.f1-circuits.loadbalancer.server.port: "8000"
# CDN cache headers are set by the app itself
networks:
- proxy
networks:
proxy:
external: true