From 37bee961ab6ae0d11b50bac21e8588addea55d3d Mon Sep 17 00:00:00 2001 From: Oleksandr Bezdieniezhnykh Date: Mon, 6 Apr 2026 05:03:27 +0300 Subject: [PATCH] Update Dockerfile for multi-architecture support and enhance coding rules - Modify Dockerfile to support multi-platform builds using TARGETARCH. - Update coderule.mdc to enforce source code organization under the `src/` directory. - Remove outdated rule from python.mdc regarding `src/` layout. --- .cursor/rules/coderule.mdc | 1 + .cursor/rules/python.mdc | 1 - Dockerfile | 6 ++++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.cursor/rules/coderule.mdc b/.cursor/rules/coderule.mdc index af70783..a90389d 100644 --- a/.cursor/rules/coderule.mdc +++ b/.cursor/rules/coderule.mdc @@ -21,3 +21,4 @@ alwaysApply: true - Make sure we don't commit binaries, create and keep .gitignore up to date and delete binaries after you are done with the task - Never force-push to main or dev branches +- Place all source code under the `src/` directory; keep project-level config, tests, and tooling at the repo root diff --git a/.cursor/rules/python.mdc b/.cursor/rules/python.mdc index fc8e934..95d0628 100644 --- a/.cursor/rules/python.mdc +++ b/.cursor/rules/python.mdc @@ -8,7 +8,6 @@ globs: ["**/*.py", "**/pyproject.toml", "**/requirements*.txt"] - Use type hints on all function signatures; validate with `mypy` or `pyright` - Use `pydantic` for data validation and serialization - Import order: stdlib -> third-party -> local; use absolute imports -- Use `src/` layout to separate app code from project files - Use context managers (`with`) for resource management - Catch specific exceptions, never bare `except:`; use custom exception classes - Use `async`/`await` with `asyncio` for I/O-bound concurrency diff --git a/Dockerfile b/Dockerfile index 110ac6e..a4d8a6b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,9 @@ -FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0 AS build +ARG TARGETARCH WORKDIR /src COPY . . -RUN dotnet publish -c Release -o /app +RUN arch=$([ "$TARGETARCH" = "amd64" ] && echo "x64" || echo "$TARGETARCH") && \ + dotnet publish -c Release -o /app --os linux --arch $arch FROM mcr.microsoft.com/dotnet/aspnet:10.0 WORKDIR /app