-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (33 loc) · 1.58 KB
/
Dockerfile
File metadata and controls
41 lines (33 loc) · 1.58 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
# Base image for runtime
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
# UID/GID passed during build (can also default to 1001)
ARG APP_UID=1001
ARG APP_GID=1001
# Create a non-root user and group
RUN groupadd -g $APP_GID appgroup && \
useradd -m -u $APP_UID -g $APP_GID appuser
# Set up secure directories (as root)
RUN mkdir -p /app /app/plugins /app/dpkeys && \
chown -R $APP_UID:$APP_GID /app /app/plugins /app/dpkeys
WORKDIR /app
EXPOSE 7236
# Switch to the non-root user
USER $APP_UID
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["src/FlowSynx.Pluginregistry/FlowSynx.Pluginregistry.csproj", "src/FlowSynx.Pluginregistry/"]
COPY ["src/FlowSynx.PluginRegistry.Infrastructure/FlowSynx.PluginRegistry.Infrastructure.csproj", "src/FlowSynx.PluginRegistry.Infrastructure/"]
COPY ["src/FlowSynx.PluginRegistry.Application/FlowSynx.PluginRegistry.Application.csproj", "src/FlowSynx.PluginRegistry.Application/"]
COPY ["src/FlowSynx.PluginRegistry.Domain/FlowSynx.PluginRegistry.Domain.csproj", "src/FlowSynx.PluginRegistry.Domain/"]
RUN dotnet restore "./src/FlowSynx.Pluginregistry/FlowSynx.Pluginregistry.csproj"
COPY . .
WORKDIR "/src/src/FlowSynx.Pluginregistry"
RUN dotnet build "./FlowSynx.Pluginregistry.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./FlowSynx.Pluginregistry.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "FlowSynx.Pluginregistry.dll"]