diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fe1152b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,30 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md +!**/.gitignore +!.git/HEAD +!.git/config +!.git/packed-refs +!.git/refs/heads/** \ No newline at end of file diff --git a/TwilioSMSReceiver/Dockerfile b/TwilioSMSReceiver/Dockerfile new file mode 100644 index 0000000..7de00f9 --- /dev/null +++ b/TwilioSMSReceiver/Dockerfile @@ -0,0 +1,26 @@ +#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +WORKDIR /app +EXPOSE 80 +EXPOSE 443 + +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["TwilioSMSReceiver/TwilioSMSReceiver.csproj", "TwilioSMSReceiver/"] +COPY ["TwilioSMSReceiver.Common/TwilioSMSReceiver.Common.csproj", "TwilioSMSReceiver.Common/"] +COPY ["TwilioSMSReceiver.Data/TwilioSMSReceiver.Data.csproj", "TwilioSMSReceiver.Data/"] +RUN dotnet restore "./TwilioSMSReceiver/./TwilioSMSReceiver.csproj" +COPY . . +WORKDIR "/src/TwilioSMSReceiver" +RUN dotnet build "./TwilioSMSReceiver.csproj" -c $BUILD_CONFIGURATION -o /app/build + +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./TwilioSMSReceiver.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "TwilioSMSReceiver.dll"] \ No newline at end of file diff --git a/TwilioSMSReceiver/TwilioSMSReceiver.csproj b/TwilioSMSReceiver/TwilioSMSReceiver.csproj index 8400d44..0392af1 100644 --- a/TwilioSMSReceiver/TwilioSMSReceiver.csproj +++ b/TwilioSMSReceiver/TwilioSMSReceiver.csproj @@ -4,6 +4,8 @@ net6.0 enable enable + 3e4db24a-abc0-4a85-9805-f073dfe1f9d6 + Linux @@ -18,6 +20,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive +