fix: run manifest containers as root and drop privileges in entrypoint

The compose file was forcing the container to run as uid 1001, so the
entrypoint could not create /workspace even with sudo configured.

- Remove Dockerfile USER directive so containers start as root
- Make compile_compose use user: 0:0 when the manifest declares a user
- Make the entrypoint drop to the container user via  after setup,
  preserving environment variables and command arguments
- Update unit tests to assert root startup and privilege drop

Quality gates:
- pytest tests/unit: 210 passed
- ruff: clean on changed files
- mypy: clean on changed files
This commit is contained in:
Developer
2026-06-14 21:32:27 +00:00
parent 47de2a0133
commit a4e6c46a47
11 changed files with 74 additions and 20 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ FastAPI backend API that manages projects, git repositories, and development too
- uv.lock | Lock file for the uv Python package manager that pins exact dependency versions and their artifact hashes for reproducible installations | dep: uv, Python 3.11+, aiosqlite, alembic, annotated-doc, annotated-types, anyio, ast-serialize, asyncpg, and many other PyPI packages
- wait-for-db.sh | Wait for a PostgreSQL database to become available before executing a command, with configurable retry logic. | dep: nc (netcat), sh (POSIX shell), sleep
## arch
Async Python/FastAPI service using multi-stage Docker builds, Alembic migrations, uv package management, and containerized deployment with Cloudflare tunneling support.
Async Python/FastAPI service using multi-stage Docker builds, Alembic migrations, uv package management, and container orchestration with external tunneling and database dependency waiting patterns.
## tags
docker, alembic, python, database, fastapi, postgresql, asyncpg, uvicorn
## symbols