0

I have a project with 3 containers (nginx, app, db). The nginx is configured correctly and working fine from public internet for url luke.jdeation.com.

The problem I am having is from one of the containers (app) I am unable to use curl or wget to connect to my url. I can ping the url fine, just not using port 80 - it just timesout.

Examples below, any idea where I should start here?

From the container (app), ping works fine:

root@c2ac3dabc259:/app# ping luke.jdeation.com
PING luke.jdeation.com (68.183.107.254) 56(84) bytes of data.
64 bytes from 68.183.107.254 (68.183.107.254): icmp_seq=1 ttl=64 time=0.030 ms
64 bytes from 68.183.107.254 (68.183.107.254): icmp_seq=2 ttl=64 time=0.086 ms
64 bytes from 68.183.107.254 (68.183.107.254): icmp_seq=3 ttl=64 time=0.085 ms

But if I try to do a wget, it just timesout:

root@c2ac3dabc259:~# wget -v luke.jdeation.com
--2020-11-29 21:09:27--  http://luke.jdeation.com/ Resolving luke.jdeation.com (luke.jdeation.com)... 68.183.107.254 Connecting to
luke.jdeation.com (luke.jdeation.com)|68.183.107.254|:80... ^C  (<-- the
ctl-c is me aborting,  it never connects)

And finally, here is my docker file:

version: "3"

services:

  #-------------------------------------------------------------------
  app:
    build: ../jdeation/docker/php
    volumes:
      - ../:/app:cached
      - ../jdeation/:/app/jdeation:cached
      - ../opencart-jdeation/:/app/opencart-jdeation:cached
      - ../jdeation/docker/php/php.ini:/usr/local/etc/php/php.ini
      - ../jdeation/docker/php/www.conf:/usr/local/etc/php/www.conf
    depends_on:
      - db
    env_file:
      - .env
    user: "1000:1000"

  #-------------------------------------------------------------------
  nginx:
    image: nginx:1.12-alpine
    ports:
      - 80:80
      - 443:443
    volumes:
      #map the jdeation files to nginx
      - ../:/app
      - ../jdeation/:/app/jdeation
      - ../opencart-jdeation/:/app/opencart-jdeation
      - ./docker/nginx/vhost.conf:/etc/nginx/conf.d/vhost.conf
    depends_on:
      - app

  #-------------------------------------------------------------------
  db:
    image: mysql:5.7
    volumes:
      - ../:/app
      - ../jdeation/docker/mysql/config.cnf:/etc/mysql/conf.d/config.cnf
      - ../persistent_data_do_not_delete/mysql_data:/var/lib/mysql #where to persist the database file system
    ports:
      - 3306:3306
    env_file:
      - .env
    environment:
      MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}

networks:
  default:
    external:
      name: jdeation
1
  • When you connect to the nginx container, what is the output of netstat -tupln? Can you confirm that nginx is running with ps -e or ps -aux (you may need to install some packages like net-tools)? Do you get a successful connection if you connect with telnet/ncat or do those fail too? – James Shewey Nov 30 '20 at 1:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.