Skip to content

which container should I open to test the app? #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mappedinn opened this issue Dec 10, 2016 · 12 comments
Closed

which container should I open to test the app? #23

mappedinn opened this issue Dec 10, 2016 · 12 comments

Comments

@mappedinn
Copy link

mappedinn commented Dec 10, 2016

Hi dears @FlyersWeb @isleshocky77 @lucacondotta @rodolfobandeira @vladapopster ,

I have already used docker-compose up -d to install all the required staff by the project.
Actually, I have these containers in my machine:

$ docker ps -a
CONTAINER ID        IMAGE                   COMMAND                  CREATED             STATUS                     PORTS                                   NAMES
039c18dcab3a        nginx                   "nginx -g 'daemon off"   58 minutes ago      Up 16 minutes              443/tcp, 0.0.0.0:8080->80/tcp           dockerify_nginx-front_1
a445ab0ad5e2        dockerify_client        "npm start"              58 minutes ago      Exited (1) 3 minutes ago                                           dockerify_client_1
d255287d0f6a        nginx                   "nginx -g 'daemon off"   2 days ago          Up About an hour           80/tcp, 443/tcp, 0.0.0.0:81->8080/tcp   dockerify_nginx-back_1
82ec1b4a5bf3        dockerify_application   "php-fpm"                2 days ago          Up About an hour           9000/tcp                                dockerify_application_1
889ba2b8f8ff        mysql                   "docker-entrypoint.sh"   2 days ago          Up About an hour           0.0.0.0:3307->3306/tcp                  dockerify_db_1

In my opinion, I should open dockerify_nginx-back_1.... But, it did not worked as expected.
Actually, I am getting access to it all I am getting is:

<!doctype html>
<html lang="en" ng-app="myApp">
  <head>
    <meta charset="utf-8">
    <title>My AngularJS App</title>
  </head>
  <body>
  </body>
</html>

PS:

  • I am getting the IP addresses of the container through the command docker inspect <container>
  • I am getting access to the server through http://172.17.0.4:8080/

Thanks...

@FlyersWeb
Copy link
Collaborator

It looks like to me that you have a problem with the dockerify-client image. Could you do a docker logs dockerify_client_1 see why it exited ?

@FlyersWeb
Copy link
Collaborator

The client will load angular scripts for dynamic wsse access, so you'll have a pure HTML page without features, that's why you're getting the page

@mappedinn
Copy link
Author

Thank you @FlyersWeb for your reply.

I will check that out and I will give you the output of docker logs dockerify_client_1 when I am back home...

@mappedinn
Copy link
Author

mappedinn commented Dec 12, 2016

Hi @FlyersWeb

Below is the error I am getting:

npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info lifecycle [email protected]~prestart: [email protected]
npm info lifecycle [email protected]~start: [email protected]

> [email protected] start /var/www
> gulp --gulpfile gulpfile.js

[13:14:38] Local gulp not found in /var/www
[13:14:38] Try running: npm install gulp

npm info lifecycle [email protected]~start: Failed to exec start script
npm ERR! Linux 4.4.0-53-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v5.12.0
npm ERR! npm  v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: `gulp --gulpfile gulpfile.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script 'gulp --gulpfile gulpfile.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the angular-symfony-front package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp --gulpfile gulpfile.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular-symfony-front
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls angular-symfony-front
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR!     /var/www/npm-debug.log

It seems to be that there are problems in installing and starting gulp.
Thanks for your help...

@mappedinn
Copy link
Author

The problem seems to be that gulp is not found in the correction location.

FlyersWeb pushed a commit that referenced this issue Dec 24, 2016
@FlyersWeb
Copy link
Collaborator

Commit 71ac8bb should correct the problem

@mappedinn
Copy link
Author

Thank you very much... I will be checking it when I am back home!

@mappedinn
Copy link
Author

I am back again...

I pulled your updates from github but I am still facing the same problem. I tried to run just a node container based on the simplest example available on https://hub.docker.com as fellows:

Creation of Dockerfile

FROM node:6.9.2-wheezy

Creation of the image

$ docker build -t node-6.9.2 .

Running a container based on the image node-6.9.2

$ docker run -d node-6.9.2

But, I do still find that the container has exited.

After googling, i found that I do need to add the flag -t. The command became $ docker run -d -t node-6.9.2.

Briefly, I made the project running through these commands:

docker-compose up -d
docker run -t -d -p 83:80 dockerify_client # since the container base on dockerify_client has exited 
# list of containers
CONTAINER ID        IMAGE                   COMMAND                  CREATED              STATUS              PORTS                          NAMES
c81d34ff59f1        dockerify_client        "npm start"              2 minutes ago       Up 2 minutes               3000/tcp, 0.0.0.0:83->80/tcp   high_euler
63de90bb3992        nginx                   "nginx -g 'daemon off"   4 minutes ago       Created                                                   dockerify_nginx-front_1
a48d328e76ca        dockerify_client        "npm start"              4 minutes ago       Exited (1) 4 minutes ago                                  dockerify_client_1
52c2665d14d2        nginx                   "nginx -g 'daemon off"   4 minutes ago       Up 4 minutes               443/tcp, 0.0.0.0:81->80/tcp    dockerify_nginx-back_1
4905a5fe0a9a        dockerify_application   "docker-php-entrypoin"   4 minutes ago       Up 4 minutes               9000/tcp                       dockerify_application_1
c096f407378d        mysql                   "docker-entrypoint.sh"   4 minutes ago       Up 4 minutes               0.0.0.0:3307->3306/tcp         dockerify_db_1

The used port by the application is 3000 not 8080 as mentionned in the documentation. In addition, I am getting error when trying to get connected from the http://172.17.0.5:3000/#/login

OPTIONS http://172.17.0.5/admin/salt net::ERR_CONNECTION_REFUSED

Questions:

  1. Is it possible to add the flag -t in docker-compose.yml so that I will not be getting a container that has exited?
  2. Is it possible to change the port from 3000 to 80? I tried that in the line 6 of index.js but without success!!!

Thanks in advance

@FlyersWeb
Copy link
Collaborator

You should better use docker-compose up -d --force-recreate --build in order to rebuild & recreate all images, this way you're sure to have an up to date docker image

@mappedinn
Copy link
Author

Thank you very much...

I will be back to you this afternoon...

What about adding the flag -t in the docker-compose.yml ? In my point of view, it is need.

@mappedinn
Copy link
Author

The problem is still the same. The flag -t is required when running the container of the dockerify_client image.

Thank you for your help

@FlyersWeb
Copy link
Collaborator

I've made a change in front start script, hope it will correct the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants