Repository navigation
Expand file tree
/
Copy pathDockerfile.worker
More file actions
49 lines (37 loc) · 1.84 KB
/
Copy pathDockerfile.worker
File metadata and controls
49 lines (37 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# syntax=docker/dockerfile:1
# =============================================================================
# Blocks IDP Worker — background workers / consumers only (no HTTP host)
# Build: docker build -f Dockerfile.worker -t blocks-idp-worker .
# =============================================================================
ARG DOTNET_PUBLISH_PLATFORM=linux/amd64
# -----------------------------------------------------------------------------
# Stage: publish — .NET SDK (glibc). Default platform linux/amd64 avoids Grpc.Tools
# protoc crashes on some arm64 build hosts; override if your CI publishes safely
# on arm64: docker build --build-arg DOTNET_PUBLISH_PLATFORM=linux/arm64 .
# -----------------------------------------------------------------------------
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS publish
WORKDIR /src
COPY server ./server
RUN dotnet publish server/Worker/Worker.csproj \
-c Release \
-o /app/publish \
--no-self-contained \
-p:DebugType=None
# -----------------------------------------------------------------------------
# Stage: runtime — ASP.NET Core runtime on Alpine (Worker targets shared
# Microsoft.AspNetCore.App via the Worker SDK / dependencies.)
# -----------------------------------------------------------------------------
FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine AS final
ARG BUILD_VERSION=0.0.0
LABEL org.opencontainers.image.title="blocks-idp-worker" \
org.opencontainers.image.description="Blocks IDP background worker (Generic Host, message consumers)." \
org.opencontainers.image.version="${BUILD_VERSION}"
WORKDIR /app
ENV DOTNET_ENVIRONMENT=Production \
DOTNET_RUNNING_IN_CONTAINER=true \
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false
RUN apk add --no-cache icu-libs
COPY --from=publish /app/publish .
RUN chown -R app:app /app
USER app
ENTRYPOINT ["dotnet", "Worker.dll"]