From 17706676d5248e3cd47c492c057965169d9ade4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Eduardo=20Garc=C3=ADa=20M=C3=A1rquez?= Date: Thu, 8 Jan 2026 11:53:28 -0500 Subject: [PATCH] fix(docker): alpine compatibility and k3s deployment fixes - Add linux-musl-x64 runtime identifier for Alpine builds - Install ICU libs for SQL Server globalization support - Fix nginx upstream to use k8s service name (student-api) - Sync package-lock.json with package.json Co-Authored-By: Claude Opus 4.5 --- deploy/docker/Dockerfile.api | 9 ++++++--- deploy/docker/Dockerfile.frontend | 2 +- deploy/docker/nginx.conf | 4 ++-- src/frontend/package-lock.json | 15 +++++++++++++-- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/deploy/docker/Dockerfile.api b/deploy/docker/Dockerfile.api index c55a0c5..9299444 100644 --- a/deploy/docker/Dockerfile.api +++ b/deploy/docker/Dockerfile.api @@ -9,15 +9,18 @@ COPY src/backend/Adapters/Driven/Persistence/*.csproj Adapters/Driven/Persistenc COPY src/backend/Adapters/Driving/Api/*.csproj Adapters/Driving/Api/ COPY src/backend/Host/*.csproj Host/ -# Restore dependencies -RUN dotnet restore Host/Host.csproj +# Restore dependencies for Alpine/musl +RUN dotnet restore Host/Host.csproj -r linux-musl-x64 # Copy source and build COPY src/backend/ . -RUN dotnet publish Host/Host.csproj -c Release -o /app --no-restore +RUN dotnet publish Host/Host.csproj -c Release -o /app -r linux-musl-x64 --self-contained false # Runtime image FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine AS runtime +# Install ICU for SQL Server globalization support +RUN apk add --no-cache icu-libs +ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false WORKDIR /app COPY --from=build /app . diff --git a/deploy/docker/Dockerfile.frontend b/deploy/docker/Dockerfile.frontend index ac9e14b..4a100fb 100644 --- a/deploy/docker/Dockerfile.frontend +++ b/deploy/docker/Dockerfile.frontend @@ -4,7 +4,7 @@ WORKDIR /app # Copy package files for caching COPY src/frontend/package*.json ./ -RUN npm ci --silent +RUN npm ci # Copy source and build COPY src/frontend/ . diff --git a/deploy/docker/nginx.conf b/deploy/docker/nginx.conf index 2b89ab9..c199f89 100644 --- a/deploy/docker/nginx.conf +++ b/deploy/docker/nginx.conf @@ -15,7 +15,7 @@ server { # API proxy location /graphql { - proxy_pass http://api:5000; + proxy_pass http://student-api:5000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; @@ -24,7 +24,7 @@ server { } location /health { - proxy_pass http://api:5000; + proxy_pass http://student-api:5000; } # Cache static assets diff --git a/src/frontend/package-lock.json b/src/frontend/package-lock.json index 5306b7b..a604ac6 100644 --- a/src/frontend/package-lock.json +++ b/src/frontend/package-lock.json @@ -12343,7 +12343,7 @@ "version": "6.0.6", "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-6.0.6.tgz", "integrity": "sha512-zgfER9s+ftkGKUZgc0xbx8T7/HMO4AV5/YuYiFc+AtgcO5T0v8AxYYNQ+ltzuzDZgNkYJaFspm5MMYLjQzrkmw==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=20" @@ -12440,6 +12440,17 @@ "tslib": "^2.0.3" } }, + "node_modules/hono": { + "version": "4.11.3", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.11.3.tgz", + "integrity": "sha512-PmQi306+M/ct/m5s66Hrg+adPnkD5jiO6IjA7WhWw0gSBSo1EcRegwuI1deZ+wd5pzCGynCcn2DprnE4/yEV4w==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=16.9.0" + } + }, "node_modules/hosted-git-info": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-9.0.2.tgz", @@ -20114,7 +20125,7 @@ "version": "8.19.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.19.0.tgz", "integrity": "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==", - "dev": true, + "devOptional": true, "license": "MIT", "engines": { "node": ">=10.0.0"