services:
  db:
    image: postgres
    restart: always
    shm_size: 128mb
    environment:
      POSTGRES_USER: guard
      POSTGRES_PASSWORD: guard
    ports:
      - "5432:5432"

  cache:
    image: redis:7.2 # or newer
    container_name: guard-redis
    ports:
      - "6379:6379"
    volumes:
      - redis-data:/data
      - ./redis.conf:/usr/local/etc/redis/redis.conf
    command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
    restart: unless-stopped

volumes:
  redis-data:
    driver: local
