Hello tout le monde,
J’ai enfin réussi à obtenir un Directus avec une base MariaDB stable avec Docker.
Je vous livre mon fichier compose pour ceux qui voudrait lancer cette configuration :
services:
db:
image: mariadb:10.3
volumes:
- ./mariadb/database:/var/lib/mysql
restart: always
environment:
LOG_LEVEL: error
PUBLIC_URL: 'https://xxxxxxxxxxxxx'
MARIADB_DATABASE: xxxxxxx
MARIADB_USER_FILE: '/run/secrets/mariadb_user'
MARIADB_PASSWORD_FILE: '/run/secrets/mariadb_password'
MARIADB_ROOT_PASSWORD_FILE: '/run/secrets/mariadb_root_password'
ports:
- 3306:3306
secrets:
- mariadb_root_password
- mariadb_user
- mariadb_password
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 5s
retries: 3
command: >
--character-set-server=utf8mb4
--collation-server=utf8mb4_bin
adminer:
image: adminer
restart: always
ports:
- 8080:8080
cache:
image: redis:6
healthcheck:
test: ["CMD-SHELL", "[ $$(redis-cli ping) = 'PONG' ]"]
interval: 10s
timeout: 5s
retries: 5
start_interval: 5s
start_period: 30s
directus:
image: directus/directus:11.0.2
ports:
- 8055:8055
volumes:
- ./directus/uploads:/directus/uploads
- ./directus/extensions:/directus/extensions
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
environment:
KEY_FILE: '/run/secrets/directus_key'
SECRET_FILE: '/run/secrets/directus_secret'
DB_CLIENT: mysql
DB_HOST: db
DB_PORT: 3306
DB_DATABASE: pickfungi
DB_USER_FILE: '/run/secrets/mariadb_user'
DB_PASSWORD_FILE: '/run/secrets/mariadb_password'
CACHE_ENABLED: "true"
CACHE_AUTO_PURGE: "true"
CACHE_STORE: "redis"
REDIS: "redis://cache:6379"
ADMIN_EMAIL_FILE: '/run/secrets/admin_email'
ADMIN_PASSWORD_FILE: '/run/secrets/admin_password'
secrets:
- mariadb_user
- mariadb_password
- directus_key
- directus_secret
- admin_email
- admin_password
caddy:
image: caddy:2.7
restart: unless-stopped
cap_add:
- NET_ADMIN
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes:
- ./caddy/Caddyfile:/etc/caddy/Caddyfile
- ./caddy/data:/data
- ./caddy/config:/config
secrets:
mariadb_root_password:
file: ./secrets/mariadb_root_password.txt
mariadb_user:
file: ./secrets/mariadb_user.txt
mariadb_password:
file: ./secrets/mariadb_password.txt
directus_key:
file: ./secrets/directus_key.txt
directus_secret:
file: ./secrets/directus_secret.txt
admin_email:
file: ./secrets/admin_email.txt
admin_password:
file: ./secrets/admin_password.txt
Maintenant que mon serveur tourne tranquillement en local sur mon PC, je dois m’attaquer à la récupération de mes données de production pour les migrer ensuite sur ce nouveau serveur. J’ai réussi à faire un Dump de mes données et j’ai récupéré la version de Directus de mon ancien serveur.
Lorsque je passe en version 9.5.2 de Directus et que je relance mon serveur, j’obtiens des problèmes avec Redis :
directus-1 | 11:29:16 ⚠️ [cache] Error: connect ECONNREFUSED 127.0.0.1:6379
directus-1 | 11:29:16 ⚠️ [cache] Error: connect ECONNREFUSED 127.0.0.1:6379
directus-1 | MaxRetriesPerRequestError: Reached the max retries per request limit (which is 20). Refer to "maxRetriesPerRequest" option for details.
directus-1 | at Socket.<anonymous> (/directus/node_modules/ioredis/built/redis/event_handler.js:177:37)
directus-1 | at Object.onceWrapper (node:events:640:26)
directus-1 | at Socket.emit (node:events:520:28)
directus-1 | at TCP.<anonymous> (node:net:687:12)
db-1 | 2024-08-30 11:29:16 10 [Warning] Aborted connection 10 to db: 'pickfungi' user: 'user' host: '172.18.0.6' (Got an error reading communication packets)
db-1 | 2024-08-30 11:29:16 9 [Warning] Aborted connection 9 to db: 'pickfungi' user: 'user' host: '172.18.0.6' (Got an error reading communication packets)
directus-1 | npm notice
directus-1 | npm notice New major version of npm available! 8.3.1 -> 10.8.3
directus-1 | npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.8.3>
directus-1 | npm notice Run `npm install -g [email protected]` to update!
directus-1 | npm notice
directus-1 exited with code 1
J’ai ajouté le port sur le cache mais j’obtiens toujours la même erreur :
cache:
image: redis:6
ports:
- 6379:6379
Si quelqu’un a une idée pour me débloquer je suis preneur