Support
Quality
Security
License
Reuse
kandi has reviewed http-server and discovered the below as its top functions. This is intended to give you an instant insight into http-server implemented functionality, and help decide if they suit your requirements.
Get all kandi verified functions for this library.
Get all kandi verified functions for this library.
a simple zero-configuration command-line http server
See all related Code Snippets
QUESTION
Docker with node.js - Error: .ngxrc not found
Asked 2022-Jan-22 at 11:17I have created a docker image with the following docker file:
FROM node:current-alpine3.14
#install the http-server
RUN npm install -g ngx
# define working directory in docker linux environment
WORKDIR /app
# copy the builded app
COPY /dist/app /app
# start the http-server in the working directory
CMD ngx start
If i run the docker image with the following command:
docker run -p 3000:3000 myapp
i got the following error:
Error Error: .ngxrc not found
at OptionManager._callee2$ (/usr/local/lib/node_modules/ngx/lib/option-manager.js:184:23)
at tryCatch (/usr/local/lib/node_modules/ngx/node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (/usr/local/lib/node_modules/ngx/node_modules/regenerator-runtime/runtime.js:296:22)
at Generator.prototype.<computed> [as throw] (/usr/local/lib/node_modules/ngx/node_modules/regenerator-runtime/runtime.js:114:21)
at step (/usr/local/lib/node_modules/ngx/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
at /usr/local/lib/node_modules/ngx/node_modules/babel-runtime/helpers/asyncToGenerator.js:30:13
I have not found infos about the error in the web.
Have somebody an idea what i do wrong?
ANSWER
Answered 2022-Jan-22 at 11:17Its because you have no .ngxrc config copied over to your image.
Copy this file in your root project folder and modify your Dockerfile:
FROM node:current-alpine3.14
#install the http-server
RUN npm install -g ngx
# define working directory in docker linux environment
WORKDIR /app
COPY .ngxrc .
# copy the builded app
COPY /dist/app /app
# start the http-server in the working directory
CMD ngx start
Rebuild your image and run the container, and the error should be gone.
of course you should modify the .ngxrc
to fit your requirements.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
No vulnerabilities reported
Save this library and start creating your kit
See Similar Libraries in
Save this library and start creating your kit
Open Weaver – Develop Applications Faster with Open Source