courselab / pollex

Open Source Online Poll Application
GNU General Public License v3.0
1 stars 9 forks source link

Containerize angular and flask #32

Closed monacofj closed 4 years ago

monacofj commented 4 years ago

Branch feature/dockerize has an initial attempt to dockerize the application. It uses two images: one for flask and another for angular sources. Flask image and container are operational. Angular image produces some warnings during build (something with angular dependencies). Also, the service runs flawlessly from withing the container; from outside, however, binding seems not work properly (seems a known problem).

From source dir:

make start_flask
wget localhost:8081/

Service responds as expected. However

make start_angular
wget localhost:8080/

Service resets the connection (it's different from refusing connection).

One may try

make login_angular
wget localhost:4200
exit

and see that it works inside de container.

Would anyone review Dockerfile-flask and Dockerfile-angular, as well as Makefile? Advice needed.

Perhaps some hints? https://stackoverflow.com/questions/53977593/unable-to-access-angular-app-in-docker-container https://github.com/angular/angular-cli/issues/4471

monacofj commented 4 years ago

Update

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/webpack-dev-server/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

This is a known issue with node Docker image. I'ts been reported as non harmful (this dependence applies to Mac but not to Linux; recommendation is to ignore it) and there seems to be no fix for the time being.

monacofj commented 4 years ago

I think PR #36 will close this.