tanmng / docker-chevereto-free

Dockerfiles for various release of Chevereto Free
38 stars 26 forks source link

No route to host Error #23

Closed fansichao closed 3 years ago

fansichao commented 3 years ago

Logs

chevereto_1  | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.20.0.3. Set the 'ServerName' directive globally to suppress this message
chevereto_1  | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.20.0.3. Set the 'ServerName' directive globally to suppress this message
chevereto_1  | [Thu Nov 26 06:26:26.497965 2020] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.38 (Debian) PHP/7.3.24 configured -- resuming normal operations
chevereto_1  | [Thu Nov 26 06:26:26.498011 2020] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
chevereto_1  | [Thu Nov 26 06:26:28.696405 2020] [php7:notice] [pid 16] [client 101.71.41.228:19968] G\\DBException: SQLSTATE[HY000] [2002] No route to host in /var/www/html/lib/G/classes/class.db.php:99\nStack trace:\n#0 /var/www/html/lib/G/classes/class.db.php(110): G\\DB->__construct()\n#1 /var/www/html/app/loader.php(61): G\\DB::getInstance()\n#2 /var/www/html/index.php(17): include_once('/var/www/html/a...')\n#3 {main}
chevereto_1  | 101.71.41.228 - - [26/Nov/2020:06:26:27 +0000] "GET / HTTP/1.1" 500 322 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"
chevereto_1  | [Thu Nov 26 06:26:28.888411 2020] [php7:notice] [pid 17] [client 101.71.41.228:23231] G\\DBException: SQLSTATE[HY000] [2002] No route to host in /var/www/html/lib/G/classes/class.db.php:99\nStack trace:\n#0 /var/www/html/lib/G/classes/class.db.php(110): G\\DB->__construct()\n#1 /var/www/html/app/loader.php(61): G\\DB::getInstance()\n#2 /var/www/html/index.php(17): include_once('/var/www/html/a...')\n#3 {main}
chevereto_1  | 101.71.41.228 - - [26/Nov/2020:06:26:27 +0000] "GET / HTTP/1.1" 500 322 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"
chevereto_1  | [Thu Nov 26 06:26:29.016416 2020] [php7:notice] [pid 18] [client 101.71.41.228:19422] G\\DBException: SQLSTATE[HY000] [2002] No route to host in /var/www/html/lib/G/classes/class.db.php:99\nStack trace:\n#0 /var/www/html/lib/G/classes/class.db.php(110): G\\DB->__construct()\n#1 /var/www/html/app/loader.php(61): G\\DB::getInstance()\n#2 /var/www/html/index.php(17): include_once('/var/www/html/a...')\n#3 {main}
chevereto_1  | 101.71.41.228 - - [26/Nov/2020:06:26:27 +0000] "GET / HTTP/1.1" 500 322 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36"

My Conf

version: '3'

services:
  db:
    image: mariadb
    volumes:
      - database:/var/lib/mysql:rw
    restart: always
    networks:
      - private
    environment:
      MYSQL_ROOT_PASSWORD: chevereto_root
      MYSQL_DATABASE: chevereto
      MYSQL_USER: chevereto
      MYSQL_PASSWORD: chevereto
    # ports:
    #   - 3306:3306

  chevereto:
    depends_on:
      - db
    image: nmtan/chevereto
    restart: always
    networks:
      - private
    environment:
      CHEVERETO_DB_HOST: db
      CHEVERETO_DB_NAME: chevereto
      CHEVERETO_DB_USERNAME: chevereto
      CHEVERETO_DB_PASSWORD: chevereto
      CHEVERETO_DB_PREFIX: chv_
      CHEVERETO_DEFAULT_TIMEZONE: Asia/Shanghai
      debug_level: 3
      # CHEVERETO_DB_PORT: 3306
    volumes:
      - chevereto_images:/var/www/html/images:rw
    ports:
      - 8004:80

networks:
  private:
volumes:
  database:
  chevereto_images:

I need help , About this Problem。

And I want volumes Config, exp: xxxx:/var/www/html/app , but this is Failed, can not have a config vloumes.

tanmng commented 3 years ago

Hello,

Thanks for the interest in the project. Sorry I couldn't get back to you earlier.

The docker-compose.yaml file that you included in here is totally correct, and is working fine for me, so I don't think that's the cause of the issue.

From the logs, it appears you have turned on the chevereto container, but not the database (that should explain why the Chevereto container cannot connect to the database one), maybe you execute docker-compose up chevereto? If that's the case, then it's a simple fix. Please try to run docker-compose down -v (to clear off everything you had earlier) and then try docker-compose up again.

Regarding the volume, that is doable, I'm not sure why you would need to do that, but you can always add another volume and mount it at the location you needed. For example:

version: '3'

services:
  db:
    image: mariadb
    volumes:
      - database:/var/lib/mysql:rw
    restart: always
    networks:
      - private
    environment:
      MYSQL_ROOT_PASSWORD: chevereto_root
      MYSQL_DATABASE: chevereto
      MYSQL_USER: chevereto
      MYSQL_PASSWORD: chevereto

  chevereto:
    depends_on:
      - db
    image: nmtan/chevereto
    restart: always
    networks:
      - private
    environment:
      CHEVERETO_DB_HOST: db
      CHEVERETO_DB_NAME: chevereto
      CHEVERETO_DB_USERNAME: chevereto
      CHEVERETO_DB_PASSWORD: chevereto
      CHEVERETO_DB_PREFIX: chv_
      CHEVERETO_DEFAULT_TIMEZONE: Asia/Shanghai
    volumes:
      - chevereto_images:/var/www/html/images:rw
      - app:/var/www/html/app:rw
    ports:
      - 8004:80

networks:
  private:
volumes:
  database:
  chevereto_images:
  app: