8f5d926d42
Audited against working Meezi/DrSousan pipelines. Fixes:
- Single docker-compose.yml is the production stack (api + internal db); folded in docker-compose.prod.yml; dev Postgres → docker-compose.dev.yml
- Dockerfile HEALTHCHECK (bash /dev/tcp) so deploy's docker-inspect Health.Status wait works
- Naming to convention: service api, container hamkadr_api/hamkadr_db, image mirror.soroushasadi.com/hamkadr/api:${API_TAG}
- Workflow rewritten to DrSousan pattern: ci build + deploy (rollback-tag before build, pg_dump backup, stop/rm/up, docker-inspect health-wait with crash detection, scoped image prune)
- environment: block with ${VAR:-default} substitution (no hard-failing env_file); HOST_PORT; .env excluded from image context
- nginx vhost + DEPLOY.md updated to match
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
24 lines
994 B
Docker
24 lines
994 B
Docker
# Hamkadr (همکادر) — .NET 10 Razor Pages. Images + NuGet pulled through Nexus (mirror.soroushasadi.com).
|
|
FROM mirror.soroushasadi.com/dotnet/sdk:10.0 AS build
|
|
WORKDIR /src
|
|
COPY nuget.docker.config /tmp/nuget.config
|
|
COPY src/ ./src/
|
|
RUN dotnet restore src/JobsMedical.Web/JobsMedical.Web.csproj --configfile /tmp/nuget.config
|
|
RUN dotnet publish src/JobsMedical.Web/JobsMedical.Web.csproj -c Release -o /out --no-restore \
|
|
/p:UseAppHost=false
|
|
|
|
FROM mirror.soroushasadi.com/dotnet/aspnet:10.0
|
|
WORKDIR /app
|
|
COPY --from=build /out ./
|
|
EXPOSE 8080
|
|
ENV ASPNETCORE_URLS=http://+:8080 \
|
|
ASPNETCORE_ENVIRONMENT=Production \
|
|
DOTNET_CLI_TELEMETRY_OPTOUT=1
|
|
|
|
# Liveness probe (TCP connect to Kestrel) — lets the deploy job wait on
|
|
# `docker inspect Health.Status`. bash ships in the Debian-based aspnet image.
|
|
HEALTHCHECK --interval=15s --timeout=10s --start-period=30s --retries=3 \
|
|
CMD bash -c 'echo > /dev/tcp/localhost/8080' || exit 1
|
|
|
|
ENTRYPOINT ["dotnet", "JobsMedical.Web.dll"]
|