Boilerplate for C# ASP .NET Core 2.1 MVC SPA (debug and release) with TypeScript, React and Redux
10K+
aspnetcore-react-redux
http://dotnetcore-flightsearch.herokuapp.com/about
https://hub.docker.com/r/jonmcquade/aspnetcore-react-redux/tags/
src directory.README.md file is dynamically loaded into the src/ClientApp/components/About component as a demonstration of a simple no-db CMS. When debugging locally in Development, you can access this same README within the app at http://localhost:5000/about. Using docker-compose -f docker-compose.dev.yml up in the root directory, it can be accessed at http://localhost:8080/about.| File | Command | Environment | Affect |
|---|---|---|---|
| package.json | npm run wp-vendor | Dev | Runs Webpack on vendor files |
| package.json | npm run wp | Dev | Runs Webpack on ClientApp files |
| package.json | npm run wp-vendor-prod | Prod | Runs Webpack on vendor files |
| package.json | npm run wp-prod | Prod | Runs Webpack on ClientApp files |
| package.json | npm install | Dev | Runs dotnet restore then runs Webpack |
| package.json | npm publish | Prod | Runs dotnet publish in Release mode |
| package.json | npm build | Prod | Runs dotnet build in Release mode |
| package.json | npm start | Dev | Runs Webpack then runs dotnet run in Debug mode |
| package.json | npm run prod | Prod | Runs Webpack then runs dotnet run in Release mode |
dotnet restore, dotnet build and dotnet publish both locally and through Docker. Distribution bundles are handled independently, allowing you to build a Debug or a Release .dll or standalone app, with dynamic hosting configurations included for Heroku port management.docker on your machine. Once installed, run this command inside of the project's root (.) directory:docker-compose -f docker-compose.dev.yml upnpm install, as well as webpack packaging are initiated automatically before the server starts.http://localhost:8080 in your browser.jonmcquade/aspnetcore-react-redux with the :dev tag.docker-compose -f docker-compose.dev.yml build in the project root (.) directory.dotnet restore is run during the build to pull down project dependencies. When the container runs, the entrypoint script is executed, then runs npm install and webpack commands inside the container to generate static site files.8080 port to the container's 3000 port../src folder is mapped to the container's /dotnetcorespa directory using shared volumes.ClientApp files, Webpack will rebundle and inject the updates to the DOM without a need to refresh the page. This is currently broken using Docker but works when debugging locally (Runtime and SDK installed on host machine)command below in the project (".") directory to publish a Production build of your app:docker-compose buildDockerfile builds a base image of jonmcquade/aspnetcore-react-redux with a tag of latest. This image is much smaller than the :dev tag because it does not include the .NET Core 2 SDK. A standalone Production build only requires the .NET Core 2 Runtime Dependency libraries.docker-compose -f docker-compose.dev.yml up creates a container named aspnetcore-react-redux-dev. You can run docker exec -ti aspnetcore-react-redux-dev shell to enter an interactive terminal into the running Docker Container that Docker Compose started. This way, you can run your shell commands directly in the Docker container, without needing to wrap your commands in the docker clr from your host.
You don't have to debug or build from the Visual Studio IDE. The dotnet CLR is installed with the .NET SDK, which allows you to run dotnet build and dotnet publish commands. These are also called when running npm build or npm publish.
npm install from the src directory will run a dotnet restore as well as run webpack to create all required file resources.npm start from the src directory will start a local instance of the Web appdotnet build -c Release -o ./app to build the .NET libraries. This does not run npm install or webpack operations.dotnet publish -c Release -o ./app to publish to the ./app directory. This performs npm install and webpack operations for you..NET Core 2.1 Runtime inside the IDE yet. In addition to targeting the framework, the framework must be installed locally when not using Docker.global.json and flightsearch.csproj project files to target a previous version of the .NET Core 2 runtime, such as the more-supported 2.0. 2.1 is a project requirement for Docker support, not for running or building locally. Changing the runtime version can cause undesired affects, has not been tested, and won't be supported at this time..NET Core 2.1 runtime. Visual Studio 2017 Preview has resolved issues with targeting the .NET Core 2.1 runtime.Content type
Image
Digest
Size
64.3 MB
Last updated
over 7 years ago
docker pull jonmcquade/aspnetcore-react-redux