FROM node:20-bookworm-slim AS editor-builder WORKDIR /build/vendor/oh-my-cv RUN corepack enable RUN corepack prepare pnpm@9.4.0 --activate COPY vendor/oh-my-cv/ ./ RUN pnpm install --frozen-lockfile --registry=https://registry.npmjs.org ENV NUXT_PUBLIC_SIGNAL_API_BASE="" RUN pnpm build-fast:pkg RUN pnpm build FROM python:3.12-slim AS python-dependencies COPY --from=ghcr.io/astral-sh/uv:0.11.31 /uv /uvx /bin/ ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ UV_COMPILE_BYTECODE=1 \ UV_HTTP_TIMEOUT=120 \ UV_LINK_MODE=copy \ UV_PROJECT_ENVIRONMENT=/opt/venv \ PATH=/opt/venv/bin:$PATH \ PYTHONPATH=/app/src WORKDIR /app COPY pyproject.toml uv.lock ./ RUN --mount=type=cache,target=/root/.cache/uv \ uv sync --frozen --no-dev --no-install-project FROM python-dependencies AS runtime COPY src/ ./src/ COPY --from=editor-builder /build/vendor/oh-my-cv/site/.output/public/ \ ./vendor/oh-my-cv/site/.output/public/ RUN groupadd --gid 1000 resume-agent \ && useradd --uid 1000 --gid resume-agent --create-home resume-agent \ && mkdir -p /app/.resume-agent /app/output \ && chown -R resume-agent:resume-agent /app USER resume-agent EXPOSE 8000 HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=5 \ CMD ["python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/healthz', timeout=5).read()"] CMD ["uvicorn", "resume_agent.webapp:app", "--host", "0.0.0.0", "--port", "8000"]