version: '3.4'
services:
  postgres:
    image: postgres:16-alpine
    environment:
      POSTGRES_PASSWORD: J5brHrAXFLQSif0K #just for local dev
      POSTGRES_DB: netbox
      POSTGRES_USER: netbox
    ports:
    - "5432:5432"
    volumes:
    - netbox-postgres-data-16:/var/lib/postgresql/data

  redis:
    image: redis:6-alpine
    command:
    - sh
    - -c # this is to evaluate the $REDIS_PASSWORD from the env
    - redis-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
    environment:
      REDIS_PASSWORD: t4Ph722qJ5QHeQ1qfu36 #just for local dev
    volumes:
    - netbox-redis-data:/data
    ports:
    - "6379:6379"
  redis-cache:
    image: redis:6-alpine
    command:
    - sh
    - -c # this is to evaluate the $REDIS_PASSWORD from the env
    - redis-server --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
    environment:
      REDIS_PASSWORD: H733Kdjndks81 #just for local dev
    ports:
    - "6378:6379"

volumes:
  netbox-postgres-data-16:
    driver: local
  netbox-redis-data:
    driver: local
