I don’t see what’s wrong about my config. Please have a look on my .env and docker compose file.
.env
KEY=secret
SECRET=secret
ADMIN_EMAIL='admin@example.com'
ADMIN_PASSWORD='admin'
DB_CLIENT=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=directus
DB_USER=directus
DB_PASSWORD=directus
docker-compose.yaml
version: '3.8'
networks:
directus:
services:
mysql:
image: mysql
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
volumes:
- ./data/database:/var/lib/mysql
networks:
- directus
phpmyadmin:
depends_on:
- mysql
image: phpmyadmin
restart: always
ports:
- "8090:80"
environment:
PMA_HOST: mysql
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
networks:
- directus
directus:
depends_on:
- mysql
image: directus/directus:latest
ports:
- 8055:8055
volumes:
- ./database:/directus/database
- ./uploads:/directus/uploads
environment:
KEY: ${KEY}
SECRET: ${SECRET}
ADMIN_EMAIL: ${ADMIN_EMAIL}
ADMIN_PASSWORD: ${ADMIN_PASSWORD}
WEBSOCKETS_ENABLED: "true"
DB_CLIENT: ${DB_CLIENT}
DB_HOST: ${DB_HOST}
DB_PORT: ${DB_PORT}
DB_DATABASE: ${DB_DATABASE}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
networks:
- directus
Terminal Show errors:
directus_test-directus-1 | [15:40:42.589] INFO: Initializing bootstrap...
directus_test-directus-1 | node:internal/process/promises:288
directus_test-directus-1 | triggerUncaughtException(err, true /* fromPromise */);
directus_test-directus-1 | ^
directus_test-directus-1 |
directus_test-directus-1 | Error: connect ECONNREFUSED 192.168.128.2:3306
directus_test-directus-1 | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
directus_test-directus-1 | --------------------
directus_test-directus-1 | at Protocol._enqueue (/directus/node_modules/.pnpm/mysql@2.18.1/node_modules/mysql/lib/protocol/Protocol.js:144:48)
directus_test-directus-1 | at Protocol.handshake (/directus/node_modules/.pnpm/mysql@2.18.1/node_modules/mysql/lib/protocol/Protocol.js:51:23)
directus_test-directus-1 | at Connection.connect (/directus/node_modules/.pnpm/mysql@2.18.1/node_modules/mysql/lib/Connection.js:116:18)
directus_test-directus-1 | at /directus/node_modules/.pnpm/knex@2.4.2_mysql@2.18.1_pg@8.11.0_sqlite3@5.1.6_tedious@16.1.0/node_modules/knex/lib/dialects/mysql/index.js:66:18
directus_test-directus-1 | at new Promise (<anonymous>)
directus_test-directus-1 | at Client_MySQL.acquireRawConnection (/directus/node_modules/.pnpm/knex@2.4.2_mysql@2.18.1_pg@8.11.0_sqlite3@5.1.6_tedious@16.1.0/node_modules/knex/lib/dialects/mysql/index.js:61:12)
directus_test-directus-1 | at create (/directus/node_modules/.pnpm/knex@2.4.2_mysql@2.18.1_pg@8.11.0_sqlite3@5.1.6_tedious@16.1.0/node_modules/knex/lib/client.js:254:39) {
directus_test-directus-1 | errno: -111,
directus_test-directus-1 | code: 'ECONNREFUSED',
directus_test-directus-1 | syscall: 'connect',
directus_test-directus-1 | address: '192.168.128.2',
directus_test-directus-1 | port: 3306,
directus_test-directus-1 | fatal: true
directus_test-directus-1 | }
directus_test-directus-1 |
directus_test-directus-1 | Node.js v18.18.0
directus_test-directus-1 exited with code 1