0

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>
link64
  • 1,944
  • 1
  • 26
  • 41
  • Is possible that you have another port 80 exposed in your host? Can you try exposing another port, for example 8084, and then launch docker with -p 8084:80? – Alejandro Galera Aug 19 '20 at 08:42
  • I'd recommend using [ServiceStack with .NET Core](https://docs.servicestack.net/netcore) if you want to run it on Linux and/or Docker, as it's a supported platform. – mythz Aug 19 '20 at 08:53
  • @mythz - long story short, we're facing a strange issue with .NET core and FTPS Implict encryption connections running on linux and this was meant to be a quick way to try and identify if that was the real cause – link64 Aug 19 '20 at 23:12

0 Answers0