This container will server an ASP.net application, via openresty with JSON-logging and embedded WAF.
Place the app in /app.
There are 2 containers built:
Each works the same way: openresty and lua-resty-waf run on port 5000
Create a Dockerfile for your application as:
FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
WORKDIR /app
COPY * /src
WORKDIR /src
RUN dotnet restore
# Copy everything else and build
COPY . /src
RUN dotnet publish -c release -o /app
FROM agilicus/dotnet
WORKDIR /app
COPY --from=build-env /app /app
and then build and test as:
tag=$(date +%Y%m%d_%H%M%S)
docker build -t MYNAME:$tag .
docker run --rm -it -p 4200:5000 MYNAME:$tag
and then open your browser to http://localhost:4200
Create a Dockerfile for your application as:
FROM mono:5 AS build-env
WORKDIR /app
COPY ./ /app
RUN nuget restore -PackagesDirectory ../packages
RUN msbuild /p:Configuration=Release\;WebOutputDir=/tmp/x\;OutDir=/tmp/x MYPROJECT.sln
FROM agilicus/dotnet
WORKDIR /app
COPY --from=build-env --chown=dotnet /tmp/x/_PublishedWebsites/MYAPP .
You may test it with:
tag=$(date +%Y%m%d_%H%M%S)
docker build -t MYNAME:$tag .
docker run --rm -it -p 4200:5000 MYNAME:$tag
and then open your browser to http://localhost:5000
It will include configuration in server-scope from /rules/server.d/. It will include configuration in location-scope from /rules/location.d/.
The wine prefix is too complicated to install inside docker. It is built outside, and a blob is placed in gcs.
Content type
Image
Digest
sha256:031f703db…
Size
551.8 MB
Last updated
over 1 year ago
docker pull agilicus/dotnetw