---
services:
  garage:
    image: dxflrs/garage:v2.1.0
    volumes:
      - ./garage.toml:/etc/garage.toml:ro
    tmpfs:
      - /var/lib/garage/meta
      - /var/lib/garage/data
    healthcheck:
      test: ["CMD", "/garage", "status"]
      interval: 2s
      timeout: 2s
      retries: 30
      start_period: 2s

  backend:
    build:
      context: ../../..
      dockerfile: Dockerfile
    environment:
      GARAGE_UI_SERVER_HOST: "0.0.0.0"
      GARAGE_UI_SERVER_PORT: "8080"
      GARAGE_UI_SERVER_ENVIRONMENT: "development"
      GARAGE_UI_GARAGE_ENDPOINT: "garage:3900"
      GARAGE_UI_GARAGE_REGION: "garage"
      GARAGE_UI_GARAGE_ADMIN_ENDPOINT: "http://garage:3903"
      GARAGE_UI_GARAGE_ADMIN_TOKEN: "smoke-admin-token-do-not-use-in-prod"
      GARAGE_UI_AUTH_ADMIN_ENABLED: "true"
      GARAGE_UI_AUTH_ADMIN_USERNAME: "smokeadmin"
      GARAGE_UI_AUTH_ADMIN_PASSWORD: "smokepass"
      GARAGE_UI_CORS_ENABLED: "false"
      GARAGE_UI_LOGGING_LEVEL: "info"
      GARAGE_UI_LOGGING_FORMAT: "json"
    ports:
      - "127.0.0.1:18080:8080"
    depends_on:
      garage:
        condition: service_healthy
