Files
v2x-server/.devcontainer/Dockerfile
T
gnickensandClaude Opus 5 c7838acbbf
CI / check (push) Canceled after 0s
Fix devcontainer build, event-loop scope, and UTC timestamps
Found by running the stack for the first time:

- compose build context pointed outside the repo. Relative paths in
  .devcontainer/compose.override.yaml resolve against the project
  directory (the repo root), not the file's own directory, so "context: .."
  escaped the repository and the image could not build at all.
- The devcontainers/python base image ships a yarn apt source whose
  signing key has rotated, failing apt-get update and the whole build.
  Drop that source list; we don't use yarn.
- pytest-asyncio ran fixtures on a session-scoped loop while tests ran on
  per-function loops, so asyncmy raised "Future attached to a different
  loop" on every database-backed test. aiosqlite masked this; MySQL does
  not. Fixture loop scope now matches the test loop scope.
- MySQL DATETIME stores no offset, so timestamps serialized bare and left
  clients guessing. Connections are pinned to UTC, so DeviceRead now
  attaches that offset explicitly, with a test covering it.

Verified end to end against real MySQL 8.4 and Keycloak 26.7: cold start
from destroyed volumes, uv sync --frozen, migrations, 41 tests, ruff,
mypy --strict, and the live authorization matrix driven by real tokens.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-10 13:02:13 -04:00

22 lines
906 B
Docker

FROM mcr.microsoft.com/devcontainers/python:1-3.13-bookworm
# `mysql` CLI for poking at the database during development.
#
# The base image ships a yarn apt source whose signing key has since rotated,
# which makes `apt-get update` fail outright. We don't use yarn, so drop that
# source list rather than carrying its key.
RUN rm -f /etc/apt/sources.list.d/yarn.list \
&& apt-get update \
&& apt-get install -y --no-install-recommends default-mysql-client \
&& rm -rf /var/lib/apt/lists/*
# Pinned rather than :latest so a rebuild months from now is reproducible.
COPY --from=ghcr.io/astral-sh/uv:0.9.7 /uv /uvx /usr/local/bin/
ENV UV_PROJECT_ENVIRONMENT=/workspaces/v2x-server/.venv \
# Bind mounts can't be hardlinked into, which is uv's default install mode.
UV_LINK_MODE=copy \
UV_COMPILE_BYTECODE=1 \
PYTHONUNBUFFERED=1 \
PATH=/workspaces/v2x-server/.venv/bin:$PATH