feat: Initialize Strata KitchenSink application boilerplate
This sets up the foundational structure for a .NET Core 6 / React project, demonstrating common architectural patterns, Docker integration, and key Strata libraries for API, data access (EF Core), background jobs (Hangfire), real-time communication (SignalR), and various frontend UI components.
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
ARG PROJECT=Strata.KitchenSink
|
||||
ARG VERSION=0.0.0
|
||||
|
||||
##############
|
||||
# Base image #
|
||||
##############
|
||||
FROM ecr.ops.stratanetwork.net/strata.microsoft.dotnet.aspnet:6.0 AS base
|
||||
|
||||
###############
|
||||
# Build image #
|
||||
###############
|
||||
FROM ecr.ops.stratanetwork.net/strata.microsoft.dotnet.sdk:6.0 AS build
|
||||
ARG PROJECT
|
||||
ARG VERSION
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
# Copy project files and restore
|
||||
COPY ["${PROJECT}.sln", "${PROJECT}.sln"]
|
||||
COPY src/**/*.csproj ./
|
||||
RUN for file in $(ls *.csproj); do mkdir -p src/${file%.*}/ && mv $file src/${file%.*}/; done
|
||||
COPY tests/**/*.csproj ./
|
||||
RUN for file in $(ls *.csproj); do mkdir -p tests/${file%.*}/ && mv $file tests/${file%.*}/; done
|
||||
|
||||
RUN dotnet restore "${PROJECT}.sln" \
|
||||
--source https://api.nuget.org/v3/index.json \
|
||||
--source https://proget.sdt.local/nuget/nuget/v3/index.json
|
||||
|
||||
|
||||
# Copy files and build
|
||||
COPY . .
|
||||
|
||||
RUN dotnet build "${PROJECT}.sln" \
|
||||
--configuration Release \
|
||||
--no-restore
|
||||
|
||||
# Run unit tests
|
||||
RUN dotnet test "${PROJECT}.sln" \
|
||||
--configuration Release \
|
||||
--no-restore \
|
||||
--no-build \
|
||||
--verbosity=normal \
|
||||
-p:CollectCoverage=true \
|
||||
-p:CoverletOutputFormat="opencover" \
|
||||
-p:CoverletOutput=/src/cover.xml
|
||||
|
||||
# Publish project
|
||||
RUN dotnet publish "src/${PROJECT}.Hangfire/${PROJECT}.Hangfire.csproj" \
|
||||
--configuration Release \
|
||||
--no-restore \
|
||||
--no-build \
|
||||
--output /app
|
||||
|
||||
###############
|
||||
# Final image #
|
||||
###############
|
||||
FROM base AS final
|
||||
ARG PROJECT
|
||||
WORKDIR /app
|
||||
ARG PROJECT
|
||||
ENV PROJECTDLL=${PROJECT}.Hangfire.dll
|
||||
ENV DOTNET_ENVIRONMENT=Development
|
||||
ENV ASPNETCORE_ENVIRONMENT=Development
|
||||
|
||||
COPY --from=build /app /app
|
||||
ENTRYPOINT dotnet ${PROJECTDLL}
|
||||
Reference in New Issue
Block a user