- Déplace les migrations du service `migrate` séparé vers un entrypoint.sh - L'API exécute `sqlx migrate run` au démarrage avant de lancer le binaire - Gestion de la rétrocompatibilité : détecte un schéma pre-sqlx et crée une baseline `_sqlx_migrations` pour éviter les conflits sur les instances existantes - Installe sqlx-cli dans le builder, copie le binaire et les migrations dans l'image finale - Supprime le service `migrate` du docker-compose.yml ; l'indexer dépend maintenant du healthcheck de l'API (qui garantit que les migrations sont appliquées) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
101 lines
2.2 KiB
YAML
101 lines
2.2 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_DB: stripstream
|
|
POSTGRES_USER: stripstream
|
|
POSTGRES_PASSWORD: stripstream
|
|
ports:
|
|
- "6432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U stripstream -d stripstream"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
meilisearch:
|
|
image: getmeili/meilisearch:v1.12
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "7700:7700"
|
|
volumes:
|
|
- meili_data:/meili_data
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:7700/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
api:
|
|
build:
|
|
context: .
|
|
dockerfile: apps/api/Dockerfile
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "7080:7080"
|
|
volumes:
|
|
- ${LIBRARIES_HOST_PATH:-./libraries}:/libraries
|
|
- ${THUMBNAILS_HOST_PATH:-./data/thumbnails}:/data/thumbnails
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
meilisearch:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:7080/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
indexer:
|
|
build:
|
|
context: .
|
|
dockerfile: apps/indexer/Dockerfile
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "7081:7081"
|
|
volumes:
|
|
- ${LIBRARIES_HOST_PATH:-./libraries}:/libraries
|
|
- ${THUMBNAILS_HOST_PATH:-./data/thumbnails}:/data/thumbnails
|
|
depends_on:
|
|
api:
|
|
condition: service_healthy
|
|
postgres:
|
|
condition: service_healthy
|
|
meilisearch:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:7081/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
backoffice:
|
|
build:
|
|
context: .
|
|
dockerfile: apps/backoffice/Dockerfile
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- PORT=7082
|
|
- HOST=0.0.0.0
|
|
ports:
|
|
- "7082:7082"
|
|
depends_on:
|
|
api:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "-O", "-", "http://127.0.0.1:7082/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
volumes:
|
|
postgres_data:
|
|
meili_data:
|