version: '3'
services:
  postgres:
    image: postgres:16.3
    ports:
      - ":5432"
    environment:
      POSTGRES_DB: quay
      POSTGRES_USER: quayuser
      POSTGRES_PASSWORD: mysecretpassword
      POSTGRES_EXTENSIONS: pg_trgm
    healthcheck:
      test: ["CMD-SHELL", "psql -U quayuser -d quay -c 'SELECT 1' || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 3
    volumes:
      - quay_postgres_data:/var/lib/postgresql/data

  redis:
    image: redis:7
    ports:
      - "6379:6379"
    volumes:
      - quay_redis_data:/data

  quay:
    image: quay.io/projectquay/quay:latest
    ports:
      - "8080:8080"
    depends_on:
      - postgres
      - redis
    environment:
      - QUAY_CONFIG_PATH=/conf/stack/config.yaml
      - QUAY_DISTRIBUTED_STORAGE_PREFERENCE=default
    volumes:
      - ./quay-config:/conf/stack
      - quay_storage:/datastorage
      - quay_tls:/tls

volumes:
  quay_postgres_data:
  quay_redis_data:
  quay_storage:
  quay_tls:

