Link to home
Start Free TrialLog in
Avatar of coder
coderFlag for Australia

asked on

docker containers doesn't communicate or talking to each other.

Hi Experts,

      I have two containers running on dockers.  

root@ip-10-252-14-11:/home/ubuntu/workarea/sourcecode/ntdl# docker container ls
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                  NAMES
596874f0eedb        dcf3be75c970        "start"             8 days ago          Up 8 days           0.0.0.0:8009->80/tcp   iiif
91c61a7ea455        8a38b977270d        "start"             8 days ago          Up 8 days           0.0.0.0:8008->80/tcp   ntdl

Open in new window


wagtail(Django)  (ntdl )application on port 8008
User generated imageimage server running independently on 8009
User generated imagewagtail (ntdl) without zoom image not communicating with iif image server
wagtail application not talking to iiif image server
User generated image
console logs details
User generated imageUser generated image
::net ERR_CONNECTION_REFUSED for accessing iiif_image server.  

nginx is installed with wagtail ntdl application
Please help me in resolving this issue.



With many thanks,
Bharath AK
Avatar of coder
coder
Flag of Australia image

ASKER

Hi Experts,

I am attaching both dockerfiles for your reference.

ntdl dockerfile

FROM ubuntu:16.04
ENV PRODUCTION true
RUN rm -f /etc/nginx
RUN apt-get update -y && apt-get install -y curl
RUN apt-get install -y software-properties-common python-software-properties
RUN add-apt-repository -y ppa:fkrull/deadsnakes
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
RUN apt-get update -y && apt-get install -y \
        git \
        libpq-dev \
        python3.6 \
        python3.6-dev \
        nginx \
        sqlite3 \
        nodejs \
        build-essential \
        curl \
        libpcre3 libpcre3-dev

RUN rm -f /usr/bin/python3
RUN ln -s /usr/bin/python3.6 /usr/bin/python3
RUN curl https://bootstrap.pypa.io/get-pip.py | python3

RUN echo "daemon off;" >> /etc/nginx/nginx.conf
RUN mkdir -p /etc/nginx/sites-available/
COPY build/docker/nginx-app.conf /etc/nginx/sites-available/default
COPY build/docker/start /usr/bin/

WORKDIR /home/ntdl
COPY build/generated/www static
COPY . code

# TODO: Remove media for production
RUN mv code/media .
ADD build/generated/bundles/* code/
WORKDIR /home/ntdl/code
RUN chmod 755 /home/ntdl/code
RUN chown -R www-data:www-data /home/ntdl/code
COPY build/docker/uwsgi_params .
COPY build/docker/uwsgi.ini .
RUN pip3 install --no-cache-dir uwsgi
RUN pip3 install --no-cache-dir -r requirements.txt

RUN npm install -g yarn
RUN yarn install

EXPOSE 80
CMD ["start"]

Open in new window


iiif image server docker file

FROM ubuntu:16.04

MAINTAINER luke.geraghty@nt.gov.au

ENV HOME /root

RUN apt-get update -y && apt-get install -y \
        wget \
        unzip \
        python-dev \
        python-setuptools \
        python-pip \
        nginx \
        libjpeg8 libjpeg8-dev libfreetype6 libfreetype6-dev zlib1g-dev liblcms2-2 \
        liblcms2-dev liblcms2-utils libtiff5-dev libpcre3 libpcre3-dev \
        imagemagick

RUN pip install --no-cache-dir Werkzeug configobj Pillow uwsgi

RUN ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/ \
        && ln -s /usr/lib/`uname -i`-linux-gnu/libjpeg.so /usr/lib/ \
        && ln -s /usr/lib/`uname -i`-linux-gnu/libz.so /usr/lib/ \
        && ln -s /usr/lib/`uname -i`-linux-gnu/liblcms.so /usr/lib/ \
        && ln -s /usr/lib/`uname -i`-linux-gnu/libtiff.so /usr/lib/ \

RUN echo "/usr/local/lib" >> /etc/ld.so.conf && ldconfig

WORKDIR /home
RUN groupadd loris
RUN useradd -g loris -d /home/loris -s /sbin/false loris
RUN mkdir -p /usr/local/share/images/loris && chown loris /usr/local/share/images/loris

# Get loris and unzip.
RUN wget --no-check-certificate https://github.com/loris-imageserver/loris/archive/v2.1.0-final.zip \
        && unzip v2.1.0-final.zip \
        && mv loris-2.1.0-final/ loris/ \
        && rm v2.1.0-final.zip

WORKDIR /home/loris
COPY docker/myresolver.py loris/
COPY docker/img_info.py loris/
RUN ./setup.py install
COPY docker/uwsgi_params .
COPY docker/uwsgi.ini .
COPY docker/loris2.conf /etc/loris2/loris2.conf
COPY docker/start /usr/bin/
COPY docker/nginx-app.conf /etc/nginx/sites-available/default

CMD ["start"]

EXPOSE 80

Open in new window


I had exposed port 80 on both the docker files but the application is running on only 8008 and 8009 not on port 80.  Do I need to configure http proxy? My application is not running on port 80.  I dont know why it is not running on port 80 as expose port 80 is there in both the docker files.   Please find below the docker network bridge details
root@ip-10-252-14-11:/home/ubuntu/workarea/sourcecode/iiifserver/docker# docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
b16547a65714        bridge              bridge              local
33c3440dbf49        host                host                local
b403764c6f7a        none                null                local

root@ip-10-252-14-11:/home/ubuntu/workarea/sourcecode/iiifserver/docker# docker network inspect bridge
[
    {
        "Name": "bridge",
        "Id": "b16547a6571491931dfb40bb310771bd71bd07bbfccb65f2c8946bb77dfbe29b",
        "Created": "2018-03-05T23:02:36.864963869Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.17.0.0/16",
                    "Gateway": "172.17.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Containers": {
            "91c61a7ea4557a62430586ddfe04041cb1433437a3401f2fc75f406dd540a94f": {
                "Name": "ntdl",
                "EndpointID": "0b05fcd2b5fcf945501928c1ba7f8f48a1124f01057660834f02f1986f777ccf",
                "MacAddress": "02:42:ac:11:00:03",
                "IPv4Address": "172.17.0.3/16",
                "IPv6Address": ""
            },
            "c9db06483096866b328e1bee7047fa5f74cfc6c9acff0b1330d6f128ee96967b": {
                "Name": "iiif",
                "EndpointID": "c74c388933a740c136f51d5e3b2214f246da3b72f722bf81b29748b9a27262f9",
                "MacAddress": "02:42:ac:11:00:02",
                "IPv4Address": "172.17.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {
            "com.docker.network.bridge.default_bridge": "true",
            "com.docker.network.bridge.enable_icc": "true",
            "com.docker.network.bridge.enable_ip_masquerade": "true",
            "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
            "com.docker.network.bridge.name": "docker0",
            "com.docker.network.driver.mtu": "1500"
        },
        "Labels": {}
    }
]

Open in new window


 Please guide me where I made a mistake
Please help me in resolving this issue.

With Many thanks,
Bharath AK
ASKER CERTIFIED SOLUTION
Avatar of BigRat
BigRat
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of coder

ASKER

Hi,

       I have a demo machine which is running on port 80.  It is created by the previous employee.  IIIF Image server is third-party application. It is not developed by us.  
This demo machine downloads all docker components from aws, It is running on ubuntu os.  it has nginx included with ntdl component. the demo machine uses separate dockerfiles for both the components. It is running on port 80.  does nginx does anything to run both the components at port 80.  Then What I have to do to make it run.   Please help me in resolving this issue.

With Many thanks,
Bharath AK
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of coder

ASKER

Hi,

     Now my problem is resolved.  

With many thanks,
Bharath AK