services:
    app:
        build:
            context: .
            dockerfile: Dockerfile
        container_name: mydrive
        volumes:
            # Use the following volumes section if you want to use bind mounts:
            # - /path/to/data:/data/
            # - /path/to/temp:/temp/

            # Use the following volumes section if you want to use named volumes:
            - mydrive-data:/data/
            - mydrive-temp:/temp/
            # Only needed when DB_ENGINE=sqlite - stores the embedded SQLite
            # metadata file, separate from mydrive-data (which holds file bytes).
            - db-data:/db-data/
        ports:
            - "${HTTP_PORT:-3000}:3000"
            # Optional: Uncomment the following line if you want to use HTTPS
            # - "${HTTPS_PORT:-8080}:8080"

        # Use expose: if using a reverse proxy
        # expose:
        #     - 3000
        #     - 8080
        env_file:
            - .env.test # Copy .env.example to .env.test or .env and fill in the values

    # Mongo service - only needed when DB_ENGINE=mongo in your env file.
    # Commented out for DB_ENGINE=sqlite testing (metadata is stored in an
    # embedded SQLite file under the db-data volume via SQLITE_DB_PATH,
    # so no separate database service is required). Note: db-data is also
    # mounted into the app service above - it's not Mongo-exclusive, it just
    # also happens to be where Mongo keeps its data.
    #
    # To bring MongoDB back: uncomment this service block below, set
    # DB_ENGINE=mongo and MONGODB_URL in your env file, then
    # `docker compose -f docker-compose-test.yml up --build`.
    # (The db-data volume stays declared below regardless, so any existing
    # Mongo data already stored in it is preserved either way.)
    #
    # mongo:
    #     image: mongo:8
    #     container_name: mongo
    #     restart: always
    #     environment:
    #         MONGO_INITDB_ROOT_USERNAME: username
    #         MONGO_INITDB_ROOT_PASSWORD: password
    #     expose:
    #         - 27017
    #     volumes:
    #         - db-data:/data/db
    #     healthcheck:
    #         test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
    #         timeout: 10s
    #         interval: 10s
    #         retries: 10
    #         start_period: 10s

# Use the following volumes section if you want to use named volumes. Useful for development.
volumes:
    mydrive-data:
    mydrive-temp:
    db-data:   # only used if the `mongo` service above is uncommented; kept declared so existing Mongo data isn't orphaned
