Make the Docker build and compose smoke test pass
Fixes found while validating `docker compose up`: - Copy .editorconfig into the build context and stop ignoring it — the in-container publish needs its analyzer suppressions (CA1848/CA1873) or warnings-as-errors fails. - npm ci uses npmjs.org (the Nexus npm proxy 404s on some packages; npmjs.org is reachable from this machine); base images + NuGet still go through the mirror. - Parameterize the Postgres/web host ports (defaults 5432/8080) so the stack doesn't clash with other local Postgres instances. Verified: image builds; `compose up` brings up Postgres (healthy) + web + worker on one image (RUN_MODE) — /health 200, /api/orgboard/ping ok, the SPA serves at /, and the worker logs "DB health: Healthy" heartbeats. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+1
-2
@@ -11,11 +11,10 @@ client/node_modules/
|
|||||||
client/dist/
|
client/dist/
|
||||||
client/.vite/
|
client/.vite/
|
||||||
|
|
||||||
# VCS / docs / local
|
# VCS / docs / local (.editorconfig is NOT ignored — the in-container build needs its analyzer rules)
|
||||||
.git/
|
.git/
|
||||||
.gitignore
|
.gitignore
|
||||||
.gitattributes
|
.gitattributes
|
||||||
*.md
|
*.md
|
||||||
docs/
|
docs/
|
||||||
.editorconfig
|
|
||||||
**/appsettings.*.local.json
|
**/appsettings.*.local.json
|
||||||
|
|||||||
+3
-1
@@ -11,6 +11,8 @@
|
|||||||
FROM mirror.soroushasadi.com/node:22-bookworm-slim AS client
|
FROM mirror.soroushasadi.com/node:22-bookworm-slim AS client
|
||||||
WORKDIR /client
|
WORKDIR /client
|
||||||
COPY client/package.json client/package-lock.json ./
|
COPY client/package.json client/package-lock.json ./
|
||||||
|
# npm packages from npmjs.org (reachable from this machine; the Nexus npm proxy 404s on some
|
||||||
|
# packages). If npmjs.org is blocked at build time, add: --registry <a working npm proxy>.
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
COPY client/ ./
|
COPY client/ ./
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
@@ -18,7 +20,7 @@ RUN npm run build
|
|||||||
# ---- Stage 2: restore + publish BOTH hosts into /app ----
|
# ---- Stage 2: restore + publish BOTH hosts into /app ----
|
||||||
FROM mirror.soroushasadi.com/dotnet/sdk:10.0 AS build
|
FROM mirror.soroushasadi.com/dotnet/sdk:10.0 AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY Directory.Build.props Directory.Packages.props nuget.config global.json ./
|
COPY Directory.Build.props Directory.Packages.props nuget.config global.json .editorconfig ./
|
||||||
COPY src/ ./src/
|
COPY src/ ./src/
|
||||||
RUN dotnet restore src/Hosts/TeamUp.Web/TeamUp.Web.csproj
|
RUN dotnet restore src/Hosts/TeamUp.Web/TeamUp.Web.csproj
|
||||||
RUN dotnet restore src/Hosts/TeamUp.Worker/TeamUp.Worker.csproj
|
RUN dotnet restore src/Hosts/TeamUp.Worker/TeamUp.Worker.csproj
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ services:
|
|||||||
POSTGRES_USER: teamup
|
POSTGRES_USER: teamup
|
||||||
POSTGRES_PASSWORD: teamup
|
POSTGRES_PASSWORD: teamup
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
# Host port is configurable to avoid clashes with other local Postgres instances.
|
||||||
|
- "${POSTGRES_HOST_PORT:-5432}:5432"
|
||||||
volumes:
|
volumes:
|
||||||
- pgdata:/var/lib/postgresql/data
|
- pgdata:/var/lib/postgresql/data
|
||||||
- ./postgres-init.sh:/docker-entrypoint-initdb.d/01-init-vector.sh:ro
|
- ./postgres-init.sh:/docker-entrypoint-initdb.d/01-init-vector.sh:ro
|
||||||
@@ -34,7 +35,7 @@ services:
|
|||||||
# The web role applies migrations; the worker waits (EF's DB-wide lock makes it safe either way).
|
# The web role applies migrations; the worker waits (EF's DB-wide lock makes it safe either way).
|
||||||
Database__ApplyMigrationsOnStartup: "true"
|
Database__ApplyMigrationsOnStartup: "true"
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "${WEB_HOST_PORT:-8080}:8080"
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|||||||
Reference in New Issue
Block a user