diff --git a/README.md b/README.md index 5f43d7a..83fe3cb 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,81 @@ stripstream-librarian/ └── .env # Environment configuration ``` +## Docker Registry + +Images are built and pushed to Docker Hub with the naming convention `docker.io/{owner}/stripstream-{service}`. + +### Publishing Images (Maintainers) + +To build and push all service images to the registry: + +```bash +# Login to Docker Hub first +docker login -u julienfroidefond32 + +# Build and push all images +./scripts/docker-push.sh +``` + +This script will: +- Build images for `api`, `indexer`, and `backoffice` +- Tag them with the current version (from `Cargo.toml`) and `latest` +- Push to the registry + +### Using Published Images + +To use the pre-built images in your own `docker-compose.yml`: + +```yaml +services: + postgres: + image: postgres:16-alpine + environment: + POSTGRES_DB: stripstream + POSTGRES_USER: stripstream + POSTGRES_PASSWORD: stripstream + volumes: + - postgres_data:/var/lib/postgresql/data + + meilisearch: + image: getmeili/meilisearch:v1.12 + environment: + MEILI_MASTER_KEY: ${MEILI_MASTER_KEY} + + api: + image: julienfroidefond32/stripstream-api:latest + env_file: + - .env + ports: + - "7080:7080" + volumes: + - ${LIBRARIES_HOST_PATH:-./libraries}:/libraries + - ${THUMBNAILS_HOST_PATH:-./data/thumbnails}:/data/thumbnails + + indexer: + image: julienfroidefond32/stripstream-indexer:latest + env_file: + - .env + ports: + - "7081:7081" + volumes: + - ${LIBRARIES_HOST_PATH:-./libraries}:/libraries + - ${THUMBNAILS_HOST_PATH:-./data/thumbnails}:/data/thumbnails + + backoffice: + image: julienfroidefond32/stripstream-backoffice:latest + env_file: + - .env + environment: + - PORT=7082 + - HOST=0.0.0.0 + ports: + - "7082:7082" + +volumes: + postgres_data: +``` + ## License [Your License Here] diff --git a/scripts/docker-push.sh b/scripts/docker-push.sh new file mode 100755 index 0000000..35f3de1 --- /dev/null +++ b/scripts/docker-push.sh @@ -0,0 +1,40 @@ +#!/bin/bash +set -e + +# Docker Hub +REGISTRY="docker.io" +OWNER="julienfroidefond32" +VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/') + +SERVICES=("api" "indexer" "backoffice") + +echo "=== Stripstream Librarian Docker Push ===" +echo "Registry: $REGISTRY" +echo "Version: $VERSION" +echo "Services: ${SERVICES[@]}" +echo "" + +for service in "${SERVICES[@]}"; do + echo "Building $service..." + docker build -f apps/$service/Dockerfile -t $service:latest . + + echo "Tagging $service..." + docker tag $service:latest $REGISTRY/$OWNER/stripstream-$service:$VERSION + docker tag $service:latest $REGISTRY/$OWNER/stripstream-$service:latest + + echo "Pushing stripstream-$service:$VERSION..." + docker push $REGISTRY/$OWNER/stripstream-$service:$VERSION + + echo "Pushing stripstream-$service:latest..." + docker push $REGISTRY/$OWNER/stripstream-$service:latest + + echo "✓ $service pushed successfully" + echo "" +done + +echo "=== All images pushed to $REGISTRY ===" +echo "Images:" +for service in "${SERVICES[@]}"; do + echo " - $REGISTRY/$OWNER/stripstream-$service:$VERSION" + echo " - $REGISTRY/$OWNER/stripstream-$service:latest" +done