Skip to content

Commit

Permalink
Merge branch 'feature/builtin-https'
Browse files Browse the repository at this point in the history
  • Loading branch information
natenho committed Dec 31, 2022
2 parents db6dcc4 + 0dc4be4 commit ef77160
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
17 changes: 15 additions & 2 deletions src/Mockaco/Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
FROM mcr.microsoft.com/dotnet/aspnet:6.0-alpine AS base
WORKDIR /app
EXPOSE 5000
EXPOSE 5443

FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim AS build

COPY ./src/Mockaco/Mockaco.csproj /src/Mockaco/
COPY ./src/Mockaco.AspNetCore/Mockaco.AspNetCore.csproj /src/Mockaco.AspNetCore/

WORKDIR /src/Mockaco
RUN dotnet restore

WORKDIR /repo
COPY ./ ./

WORKDIR /repo/src/Mockaco
RUN dotnet build "Mockaco.csproj" -c Release -o /app/build
RUN find -iname gitversion.json -exec cat {} \;
RUN dotnet dev-certs https

FROM build AS publish
RUN dotnet publish "Mockaco.csproj" -c Release -o /app/publish
Expand All @@ -19,9 +26,15 @@ FROM base AS final
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
ENV ASPNETCORE_ENVIRONMENT=Docker
WORKDIR /app

COPY --from=publish /app/publish .
COPY ./src/Mockaco/Mocks/hello.json /app/Mocks/
COPY ./src/Mockaco/Settings /app/Settings
COPY ./src/Mockaco/Mocks/hello.json ./Mocks/
COPY ./src/Mockaco/Settings ./Settings

COPY --from=build /root/.dotnet/corefx/cryptography/x509stores/my /root/.dotnet/corefx/cryptography/x509stores/my

VOLUME /app/Mocks
VOLUME /app/Settings
VOLUME /root/.dotnet/corefx/cryptography/x509stores/my

ENTRYPOINT ["dotnet", "Mockaco.dll"]
2 changes: 1 addition & 1 deletion src/Mockaco/Settings/appsettings.Docker.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Urls": "http://+:5000",
"Urls": "http://+:5000;https://+:5443",
"Mockaco": {
"TemplateFileProvider": {
"Path": "Mocks"
Expand Down

0 comments on commit ef77160

Please sign in to comment.