[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Hosting Angular/nodejs -app in OpenShift 3.1

I just want to make my problem clear, so that's the reason for this new, longer message. Thanks . I tried already a lot.

I've created everything new.
So what I've done:
oc new-app image1 --name nginx
oc new-app image2 --name nodejs

See screenshot for the scenario at the moment.
The nginx-container is in a backoff restart-loop because it can't find nodejs:8888 (container-name and open port on the container).

Why is nginx searching for this container. Well, take a look to the nginx.conf
events { worker_connections 1024; }

http {
        include /etc/nginx/mime.types;

        upstream node-app {
              server nodejs:8888 weight=10 max_fails=3 fail_timeout=30s;
        server {
              listen 80;

              root /usr/share/nginx/html/dist;
              location / {
                index index.html;

              location /api {
                proxy_pass http://node-app;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;

So this is working fine when I just ran the containers like this:
docker run --restart=always -d --name "nodejs" image:${version}
docker run --restart=always -d -p 80:80 --name nginx --link nodejs:nodejs image:${version}

So I tried to put them under the same service, but it did not seem to help.

Attachment: Screen Shot 2016-01-27 at 14.37.10.png
Description: PNG image

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]