services:
  minio:
    image: minio/minio
    user: "1000"
    environment:
      - MINIO_ROOT_USER=topsecret
      - MINIO_ROOT_PASSWORD=topsecret
    volumes:
      - ./storage/minio:/data
    command: [ "minio", "server", "/data", "--console-address", ":9090" ]
    ports:
      - 9000:9000
      - 9090:9090
    expose:
      - 9000

  db:
    image: postgres
    user: "1000"
    ports:
      - "5432:5432"
    expose:
      - 5432
    environment:
      - POSTGRES_USER=user
      - POSTGRES_PASSWORD=pass
      - POSTGRES_DB=moneymgr
    volumes:
      - ./storage/db:/var/lib/postgresql/data

  oidc:
    image: dexidp/dex
    user: "1000"
    ports:
      - 9001:9001
    volumes:
      - ./docker/dex:/conf:ro
    command: [ "dex", "serve", "/conf/dex.config.yaml" ]

  redis:
    image: redis:alpine
    user: "1000"
    command: redis-server --requirepass ${REDIS_PASS:-secretredis}
    ports:
      - 6379:6379
    volumes:
      - ./storage/redis-data:/data
      - ./storage/redis-conf:/usr/local/etc/redis/redis.conf