F1 circuit layouts with year-by-year SVGs — manually traced track variations
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
951B

  1. FROM python:3.12-alpine
  2. WORKDIR /app
  3. # Runtime deps:
  4. # - cairo provides libcairo so cairosvg can rasterise SVG → PNG.
  5. # - ttf-liberation gives Liberation Sans Bold at
  6. # /usr/share/fonts/liberation/LiberationSans-Bold.ttf — exactly where Arch
  7. # installs it, so dev (shanks) and prod (this container) render with the
  8. # same font and the posters come out identical.
  9. RUN apk add --no-cache \
  10. cairo \
  11. ttf-liberation
  12. # All pip deps ship musllinux wheels — no build-deps needed.
  13. # numpy is pulled in by models/geo_json/geometry.py for vector ops at import time.
  14. RUN pip install --no-cache-dir \
  15. fastapi \
  16. uvicorn \
  17. python-slugify \
  18. pillow \
  19. cairosvg \
  20. numpy
  21. COPY cdn-api.py circuits_service.py ergast_service.py posters_service.py ./
  22. COPY models/ ./models/
  23. COPY circuits/ ./circuits/
  24. EXPOSE 8000
  25. CMD ["uvicorn", "cdn-api:app", "--host", "0.0.0.0", "--port", "8000"]