version: '3'

services:
  kutt:
    build: .
    container_name: kutt
    depends_on:
      - postgres
      - redis
    ports:
      - "4000:4000"
    env_file: 
      - .env
    environment:
      DB_HOST: postgres
      DB_NAME: kutt
      DB_USER: user
      DB_PASSWORD: pass
    networks:
      - kutt-network
    
  redis:
    image: redis:alpine
    container_name: redis
    networks:
      - kutt-network

  postgres:
    image: postgres:12-alpine
    container_name: postgres
    environment:
      POSTGRES_USER: user
      POSTGRES_PASSWORD: pass
      POSTGRES_DB: kutt
    ports:
      - "54323:5432"
    networks:
      - kutt-network

networks:
  kutt-network:
    driver: "bridge"