0

几天来,我一直试图让 osTicket 在 Docker / Portainer 上运行。但它不会起作用。我创建了自己的模板:

version: '2'

services:
   db:
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: ${MYSQL_DATABASE_PASSWORD}
       MYSQL_DATABASE: osticket
       MYSQL_USER: osticket
       MYSQL_PASSWORD: osticket_pw_123_!

   osticket:
     image: osticket/osticket
     ports:
       - 80
     restart: always
     environment:
       MYSQL_DB_HOST: db:3306
       MYSQL_USER: osticket
       MYSQL_ROOT_PASSWORD: ***
       MYSQL_PASSWORD: ***
  
volumes:
    osticket_data:

当我在浏览器中调用 osTicket 容器时,出现“无法连接到服务器”。

mySQL 容器正在运行并显示:

2022-02-02T14:32:52.779089Z 0 [Note] mysqld: ready for connections.

osTicket 容器正在运行并显示:

Install/Update osTicket
Configuring mail settings
OSTicket cron job is set to run every 5 minutes
Using external MySQL connection
Waiting for database TCP connection to become available...

网络也不错。。。

Containers in network:
osticket_osticket_1  172.19.0.3/16
osticket_db_1       172.19.0.2/16

为什么他们找不到对方?为什么 osTicket 容器没有响应?

非常非常感谢您的帮助!

4

1 回答 1

0

我的自定义堆栈:

version: '2'

services:
mysql:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
ports:
- 3306
expose:
- 3306
environment:
MYSQL_ROOT_PASSWORD: myrootpassword
MYSQL_DATABASE: osticket
MYSQL_USER: osticket
MYSQL_PASSWORD: osticket
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10

osticket:
image: osticket/osticket:latest
ports:
- 80
restart: always
depends_on:
mysql:
condition: service_healthy
links:
- mysql:db
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_HOST: mysql
MYSQL_PORT: 3306
MYSQL_USER: osticket
MYSQL_PASSWORD: osticket

volumes:
db_data:

[看这里:] [1]:https ://www.bluestonedesign.de/faq/19-software-tools/698-osticket-in-portainer-docker

于 2022-03-02T11:16:47.950 回答