-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.api
More file actions
52 lines (42 loc) · 2.26 KB
/
Dockerfile.api
File metadata and controls
52 lines (42 loc) · 2.26 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
50
51
52
# syntax=docker/dockerfile:1.7
# Build stage — restore + publish the API
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
# Layer-friendly restore
COPY global.json Directory.Build.props adaptiveapi.slnx ./
COPY src/AdaptiveApi.Core/*.csproj src/AdaptiveApi.Core/
COPY src/AdaptiveApi.Api/*.csproj src/AdaptiveApi.Api/
COPY src/AdaptiveApi.Infrastructure/*.csproj src/AdaptiveApi.Infrastructure/
COPY src/AdaptiveApi.Providers.OpenAI/*.csproj src/AdaptiveApi.Providers.OpenAI/
COPY src/AdaptiveApi.Providers.Anthropic/*.csproj src/AdaptiveApi.Providers.Anthropic/
COPY src/AdaptiveApi.Providers.Mcp/*.csproj src/AdaptiveApi.Providers.Mcp/
COPY src/AdaptiveApi.Providers.Generic/*.csproj src/AdaptiveApi.Providers.Generic/
COPY src/AdaptiveApi.Mcp.TranslateApi/*.csproj src/AdaptiveApi.Mcp.TranslateApi/
COPY src/AdaptiveApi.Translators.Passthrough/*.csproj src/AdaptiveApi.Translators.Passthrough/
COPY src/AdaptiveApi.Translators.DeepL/*.csproj src/AdaptiveApi.Translators.DeepL/
COPY src/AdaptiveApi.Translators.Llm/*.csproj src/AdaptiveApi.Translators.Llm/
COPY src/AdaptiveApi.Pii.Presidio/*.csproj src/AdaptiveApi.Pii.Presidio/
RUN dotnet restore src/AdaptiveApi.Api/AdaptiveApi.Api.csproj
# Copy sources
COPY src/ src/
COPY catalog/ catalog/
RUN dotnet publish src/AdaptiveApi.Api/AdaptiveApi.Api.csproj -c Release -o /app --no-restore
# Runtime stage
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
WORKDIR /app
# wget for the compose healthcheck (base image ships no http client).
RUN apt-get update \
&& apt-get install -y --no-install-recommends wget ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /app ./
# Catalog file is loaded at startup; ship it alongside the binary.
COPY --from=build /src/catalog ./catalog
ENV ASPNETCORE_URLS=http://+:8080 \
ASPNETCORE_ENVIRONMENT=Production \
Database__Path=/data/adaptiveapi.db \
Mcp__CatalogFile=/app/catalog/mcp-servers.json
VOLUME ["/data"]
EXPOSE 8080
HEALTHCHECK --interval=15s --timeout=3s --start-period=15s --retries=5 \
CMD wget -qO- http://localhost:8080/healthz > /dev/null 2>&1 || exit 1
ENTRYPOINT ["dotnet", "AdaptiveApi.Api.dll"]