services:
    # for local file uploads
    minio:
        env_file:
            - path: .env.docker-compose.dev
              required: true
        extends:
            file: docker-compose.base.yml
            service: minio
        networks:
            - app-network
        volumes:
            - ./.local_data/files:/data
        ports:
            - "9000:9000"

    db:
        env_file:
            - path: .env.docker-compose.dev
              required: true
        extends:
            file: docker-compose.base.yml
            service: db
        volumes:
            - postgres-data:/var/lib/postgresql/data
        ports:
            - 54322:5432

    inbucket:
        env_file:
            - path: .env.docker-compose.dev
              required: true
        extends:
            file: docker-compose.base.yml
            service: inbucket
        networks:
            - app-network

    cache:
        env_file:
            - path: .env.docker-compose.dev
              required: true
        extends:
            file: docker-compose.base.yml
            service: cache
        networks:
            - app-network
        ports:
            - 6379:6379

    minio-init:
        env_file:
            - path: .env.docker-compose.dev
              required: true
        healthcheck:
            test: ["CMD", "echo", "true"]
            interval: 1m30s
            timeout: 30s
            retries: 5
            start_period: 30s
        extends:
            file: docker-compose.base.yml
            service: minio-init
        depends_on:
            minio:
                condition: service_healthy
        networks:
            - app-network

networks:
    app-network:

volumes:
    postgres-data:
        driver: local
