Tailored to multi-project solutions:
Dockerfile:
FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine AS builder
WORKDIR /app
COPY <other-proj-dir>/*.csproj <other-proj-dir>/
COPY <web-proj-dir>/*.csproj <web-proj-dir>/
RUN dotnet restore | namespace Sqids; | |
| public class SqidsOptions | |
| { | |
| public string Alphabet { get; set; } = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | |
| public HashSet<string> BlockList { get; set; } = new() { /* TODO */ }; | |
| public int MinLength { get; set; } = 10; | |
| } | |
| public class SqidsGenerator |
| namespace Sqids; | |
| public class SqidsOptions | |
| { | |
| public string Alphabet { get; set; } = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; | |
| public HashSet<string> BlockList { get; set; } = new() { /* TODO */ }; | |
| public int MinLength { get; set; } = 10; | |
| } | |
| public class SqidsGenerator |
| public static class AddValidationFilterExtension | |
| { | |
| public static TBuilder AddValidationFilter<TBuilder>( | |
| this TBuilder builder | |
| ) where TBuilder : IEndpointConventionBuilder | |
| { | |
| return builder.AddEndpointFilterFactory((factoryCtx, next) => | |
| { | |
| var sp = factoryCtx.ApplicationServices.GetRequiredService<IServiceProviderIsService>(); | |
| var validatableParameters = factoryCtx.MethodInfo.GetParameters() |
| namespace Translator; | |
| public static class QueryableExtensions | |
| { | |
| public static IQueryable<T> AsTranslatable<T>(this IQueryable<T> source) | |
| { | |
| if (source is TranslatableQuery<T> query) | |
| return query; | |
| return new TranslatableQueryProvider(source.Provider).CreateQuery<T>(source.Expression); |
*This Dockerfile is intended for SvelteKit applications that use adapter-node. So, the Dockerfile below assumes that you have already installed and configured the adapter.
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json .
RUN npm ci
COPY . .
RUN npm run build