version: "3"

services:
  redis:
    image: redis:5
    container_name: redash-redis
    restart: always

  redash-server:
    image: redash/redash:10.1.0.b50633
    container_name: redash-server
    command: server
    depends_on:
      - redis
    environment:
      REDASH_COOKIE_SECRET: "${REDASH_COOKIE_SECRET}"
      REDASH_SECRET_KEY: "${REDASH_SECRET_KEY}"
      REDASH_DATABASE_URL: "postgresql://postgres:HP_LE1851w@192.168.1.140:5432/redash"
      REDASH_REDIS_URL: "redis://redash-redis:6379/0"
    ports:
      - "5000:5000"
    restart: always

  redash-scheduler:
    image: redash/redash:10.1.0.b50633
    container_name: redash-scheduler
    command: scheduler
    depends_on:
      - redis
    environment:
      REDASH_COOKIE_SECRET: "${REDASH_COOKIE_SECRET}"
      REDASH_SECRET_KEY: "${REDASH_SECRET_KEY}"
      REDASH_DATABASE_URL: "postgresql://postgres:HP_LE1851w@192.168.1.140:5432/redash"
      REDASH_REDIS_URL: "redis://redash-redis:6379/0"
    restart: always

  redash-worker:
    image: redash/redash:10.1.0.b50633
    container_name: redash-worker
    command: worker
    depends_on:
      - redis
    environment:
      REDASH_COOKIE_SECRET: "${REDASH_COOKIE_SECRET}"
      REDASH_SECRET_KEY: "${REDASH_SECRET_KEY}"
      REDASH_DATABASE_URL: "postgresql://postgres:HP_LE1851w@192.168.1.140:5432/redash"
      REDASH_REDIS_URL: "redis://redash-redis:6379/0"
    restart: always
