Unable to get ServiceStack services running with xsp4 and docker

169 Views Asked by At

I am trying to run a barebones asp.net application with servicestack via mono and xsp in docker. The application builds as expected and the web server starts. I can connect to the shell of the container and have confirmed all the dll's have built correctly and are in the bin directory.

However, whenever I navigate to the site and attempt to hit a service (e.g. http://mysite/metadata), I receive a 404. If I place a regular html file in the root, it is served correctly.

I believe I must be missing something in terms of getting the ServiceStack services to run. I have a Global.asax file and everything works as expected locally. Below is the docker file and the web.config file

Docker File

FROM mono:6.6.0.161

RUN mono --version
COPY . .
RUN  apt-get update && apt-get install -y mono-xsp \
  && apt-get autoremove -y && apt-get clean \
  && rm -rf /var/lib/apt/lists/* /tmp/*

RUN nuget restore app.sln
RUN msbuild app.sln


WORKDIR /app

EXPOSE 80

ENTRYPOINT ["xsp4", "--port","80"]

web.config

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  https://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.7.2"/>
    <httpRuntime/>
    <pages controlRenderingCompatibilityVersion="4.0"/>
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <handlers>
      <add path="*" name="ServiceStack.Factory" preCondition="integratedMode" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*" resourceType="Unspecified" allowPathInfo="true"/>
    </handlers>
  </system.webServer>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>
</configuration>
0

There are 0 best solutions below