generator-angular-fullstack icon indicating copy to clipboard operation
generator-angular-fullstack copied to clipboard

Angular-fullstack 4.2.2 Docker image fails

Open aabm00 opened this issue 8 years ago • 3 comments

  • [x] I understand that GitHub issues are not for tech support, but for questions specific to this generator, bug reports, and feature requests.
Item Version
generator-angular-fullstack 4.2.2
Node 6.9.2
npm 3.10.9
Operating System Windows 7
etc etc
Item Answer
Transpiler TypeScript
Markup HTML
CSS CSS
Router ui-router
Client Tests Jasmine
DB MongoDB
Auth Y
etc etc

Hi I know you are working to add Docker functionality to angular-fullstack but I want to get a Docker image of a project based on generator-angular-fullstack 4.2.2 to upload it to Google Clod Platform and take advantage of kubernetes to manage the app.

I ask here because I think you know better how angular-fullstack works and probably where the problem can come from. Sorry If not so :(

I generate a DockerFile and placed it in the dist folder to generate the image:

FROM node:6.9.2

RUN mkdir -p /app
WORKDIR /app
COPY . ./
RUN npm install

CMD ["node", "server/index.js"]

After that I create the Docker image in the Docker console

$ docker build -t [project name] [path]

The image was generated

But when I try to test it with the command

$ docker run [project name]

I get this error:

Error: Cannot find module '../../webpack.make'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.exports.default (/app/server/config/express.js:72:29)
    at Object.<anonymous> (/app/server/app.js:51:1)
    at Module._compile (module.js:570:32)
    at loader (/app/node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/app/node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/app/server/index.js:12:28)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

I am just starting with Kubernetes and Docker so I am sure I have made a mistake. So Idea?

I wanted to ask too If I Have had to add MongoDB in the dependencies in the packcage,json to be installed in the same container.

Thanks

aabm00 avatar Jun 16 '17 17:06 aabm00

You can take a look at my personal website's Dockerfile: https://github.com/Awk34/aksite/blob/master/_Dockerfile

I run this app as well as others under Kubernetes on GCP

Awk34 avatar Jun 17 '17 00:06 Awk34

Very very much thanks you to share this info.

I'll take a look and and try to get it running on my app and upload to GCP. Now I am only trying to get running a plain app created by the generator 4.2.2, and if I am success start to improve the base app.

Thanks again

aabm00 avatar Jun 17 '17 13:06 aabm00

No problem. I also have an incomplete branch on the generator with similar code: https://github.com/angular-fullstack/generator-angular-fullstack/blob/docker/templates/app/Dockerfile

Awk34 avatar Jun 17 '17 19:06 Awk34