services:
  postgres:
    image: postgres:latest
    container_name: postgres-db
    environment:
      POSTGRES_USER: ${POSTGRES_USER:-user}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
      POSTGRES_DB: ${POSTGRES_DB:-time_tracking_db}
    ports:
      - "${POSTGRES_PORT:-5432}:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data

  pgadmin:
    image: dpage/pgadmin4:latest
    container_name: pgadmin
    environment:
      PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-admin@admin.com}
      PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
      #PGADMIN_CONFIG_SERVER_MODE: 'False'
    ports:
      - "5050:80"

  redis:
    image: redis/redis-stack:latest
    #image: redis:latest
    container_name: redis-server
    ports:
      - "${REDIS_PORT:-6379}:6379"
      - "8001:8001" # RedisInsight WebUI
    #environment:
    #  - REDIS_ARGS=--requirepass ${REDIS_PASSWORD:-password}
    volumes:
      - redis_data:/data
      - ./_common/docker/redis.conf:/usr/local/etc/redis/redis.conf
    #command: ["redis-server", "/usr/local/etc/redis/redis.conf"]

volumes:
  postgres_data:
  redis_data:
