Docker support: SPA angular and .NETCore 2.0 #225

Closed
opened 2025-08-09 17:15:29 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @jfernandeze on 1/16/2018

I'm trying to add docker to template angular spa with .NET Core 2.0. I added docker support with Visual Studio 2017 and when I launch the application with docker-compose I have an error in

app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { HotModuleReplacement = true, });

This is the exception:

"One or more errors occurred. (Failed to start Node process. To resolve this:.\n\n[1] Ensure that Node.js is installed and can be found in one of the PATH directories.\n Current PATH environment variable is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n Make sure the Node executable is in one of those directories, or update your PATH.\n\n[2] See the InnerException for further details of the cause.)"

The dockerfile has:
FROM microsoft/aspnetcore:2.0 AS base
WORKDIR /app
EXPOSE 80

I've modified the Dockfile with:

FROM microsoft/aspnetcore:2.0 AS base
RUN curl -sL https://deb.nodesource.com/setup_6.x
RUN bash -
RUN apt-get -y update
RUN apt-get install -y build-essential nodejs
RUN ln -s /usr/local/bin/node /usr/local/bin/nodejs
WORKDIR /app
EXPOSE 80

When I launch Dockercompose I have the following error on the same line:

"One or more errors occurred. (Unexpected token {\nSyntaxError: Unexpected token {\n at exports.runInThisContext (vm.js:53:16)\n at Module._compile (module.js:373:25)\n at Object.Module._extensions..js (module.js:416:10)\n at Module.load (module.js:343:32)\n at Function.Module._load (module.js:300:12)\n at Module.require (module.js:353:17)\n at require (internal/module.js:12:17)\n at Object.<anonymous> (/app/node_modules/@ngtools/webpack/src/index.js:22:10)\n at Module._compile (module.js:409:26)\n at Object.Module._extensions..js (module.js:416:10))"

Of course i'd like to use HMR with webpack and Docker

*Originally created by @jfernandeze on 1/16/2018* I'm trying to add docker to template angular spa with .NET Core 2.0. I added docker support with Visual Studio 2017 and when I launch the application with docker-compose I have an error in ` app.UseWebpackDevMiddleware(new WebpackDevMiddlewareOptions { HotModuleReplacement = true, });` This is the exception: `"One or more errors occurred. (Failed to start Node process. To resolve this:.\n\n[1] Ensure that Node.js is installed and can be found in one of the PATH directories.\n Current PATH environment variable is: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n Make sure the Node executable is in one of those directories, or update your PATH.\n\n[2] See the InnerException for further details of the cause.)"` The dockerfile has: `FROM microsoft/aspnetcore:2.0 AS base` `WORKDIR /app` `EXPOSE 80` I've modified the Dockfile with: `FROM microsoft/aspnetcore:2.0 AS base` `RUN curl -sL https://deb.nodesource.com/setup_6.x` `RUN bash -` `RUN apt-get -y update` `RUN apt-get install -y build-essential nodejs` `RUN ln -s /usr/local/bin/node /usr/local/bin/nodejs` `WORKDIR /app` `EXPOSE 80` When I launch Dockercompose I have the following error on the same line: `"One or more errors occurred. (Unexpected token {\nSyntaxError: Unexpected token {\n at exports.runInThisContext (vm.js:53:16)\n at Module._compile (module.js:373:25)\n at Object.Module._extensions..js (module.js:416:10)\n at Module.load (module.js:343:32)\n at Function.Module._load (module.js:300:12)\n at Module.require (module.js:353:17)\n at require (internal/module.js:12:17)\n at Object.<anonymous> (/app/node_modules/@ngtools/webpack/src/index.js:22:10)\n at Module._compile (module.js:409:26)\n at Object.Module._extensions..js (module.js:416:10))"` Of course i'd like to use HMR with webpack and Docker
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#225
No description provided.