quicklyon / zentao-docker

Quickon Docker Image for ZenTao(禅道官方容器镜像)
Other
26 stars 10 forks source link

docker-compose运行后一直重启 #10

Closed manongqiyin closed 1 year ago

manongqiyin commented 1 year ago

我的docker-compose 的配置如下:

version: '3' services: zentao: image: easysoft/quickon-zentao:18.5 restart: always ports:

用docker-compose 的指令运行后,一直重启。查看docker logs 输出信息如下: 16:30:09.42 Welcome to the Easysoft ZenTao 18.5 container 16:30:09.42 Subscribe to project updates by watching https://www.zentao.net 16:30:09.43 Submit issues and feature requests at https://www.zentao.net/ask.html 16:30:09.43 16:30:09.44 INFO ==> Prepare persistence directories. 16:30:09.56 INFO ==> Render php.ini with environment variables. 16:30:09.57 INFO ==> render template php.ini for amd64 16:30:09.63 INFO ==> Render apache sites config with envionment variables. 16:30:09.69 INFO ==> Check whether the MySQL is available. 16:30:09.69 INFO ==> MySQL is ready. 16:30:09.69 INFO ==> Check ZenTao 18.5 database.

就卡在数据库这里了

ysicing commented 1 year ago

@manongqiyin quickon-zentao 默认没有mysql,有跑mysql服务么, 可以参考 docker-compose.yml.example

manongqiyin commented 1 year ago

@manongqiyin quickon-zentao 默认没有mysql,有跑mysql服务么, 可以参考 docker-compose.yml.example

本地有跑mysql服务的,只是mysql没用docker。MYSQL_HOST和MYSQL_PORT都正确的指向了我本地跑的mysql

ysicing commented 1 year ago

看日志报错,应用是检查数据库 Check ZenTao 18.5 database., 具体就是执行mysql

mysql -u --host=$MYSQL_HOST --port=$MYSQL_PORT --user=$MYSQL_USER --password=$MYSQL_PASSWORD --execute="CREATE DATABASE IF NOT EXISTS  $MYSQL_DB"

手动执行一下看看或者开启debug模式

manongqiyin commented 1 year ago

看日志报错,应用是检查数据库 Check ZenTao 18.5 database., 具体就是执行mysql

mysql -u --host=$MYSQL_HOST --port=$MYSQL_PORT --user=$MYSQL_USER --password=$MYSQL_PASSWORD --execute="CREATE DATABASE IF NOT EXISTS  $MYSQL_DB"

手动执行一下看看或者开启debug模式 docker-compose后未能创建数据库, 开了debug后,Check ZenTao 18.5 database的logs信息如下:

  • debug_execute /usr/bin/mysql --host= --port= --user=zentao --password=*** '--execute=CREATE DATABASE IF NOT EXISTS zentao;'
  • is_boolean_yes false
  • local -r bool=false
  • shopt -s nocasematch
  • [[ false = 1 ]]
  • [[ false =~ ^(yes|true)$ ]]
  • false
  • /usr/bin/mysql --host= --port= --user=zentao --password=*** '--execute=CREATE DATABASE IF NOT EXISTS zentao;'
  • return 1
  • exit 1

如果手动执行 mysql -u --host=$MYSQL_HOST --port=$MYSQL_PORT --user=$MYSQL_USER --password=$MYSQL_PASSWORD --execute="CREATE DATABASE IF NOT EXISTS $MYSQL_DB"的话,有一个警告: mysql: [Warning] Using a password on the command line interface can be insecure. 但是执行该条指令后能创建数据库

ysicing commented 1 year ago

还有一个可能就是容器内没法访问你的数据库,你可以先试试将容器网络改成host模式看看,或者用我们提供的mysql镜像启动看看