Multistage docker build
- Lets try a dotnet application
Sample API Application
- Refer Here for repo
- Look into readme.md for instructions of building and running the applications
Points To consider
- run the application also on other interfaces apart for lo(localhost) =>
0.0.0.0 - For dotnet Refer Here
- Refer Here for changes
- Sample Dockerfile
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS builder
COPY . /app
WORKDIR /app
RUN dotnet publish -c Release -o ./published/
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS application
EXPOSE 5000
COPY --from=builder /app/published /app
WORKDIR /app
ENV ASPNETCORE_URLS=http://+:5000
CMD ["dotnet", "DockerDotnetCore.dll"]
Reactjs application
- Refer Here
- Exercise: Write a multistage docker file where the react application should run on nginx.
- IN dotnet image we have not create a user. Add that
