services:
  server:
    build:
      context: ./server
    environment:
      NODE_ENV: production
    ports:
      - 3005:3005
    restart: unless-stopped
    depends_on:
      redis:
        condition: service_healthy
      db:
        condition: service_healthy

  redis:
    image: "redis:alpine"
    container_name: "redis"
    expose:
      - 6379
    volumes:
      - redis-data:/data
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5

  db:
    image: postgres
    restart: always
    user: postgres
    volumes:
      - db-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_USER=velox
      - POSTGRES_DB=veloxwallet
      - POSTGRES_PASSWORD=aboIuWe47yutb089q
    expose:
      - 5432
    ports:
      - 5432:5432
    healthcheck:
      test: ["CMD", "pg_isready"]
      interval: 10s
      timeout: 5s
      retries: 5

  adminer:
    image: adminer
    restart: always
    ports:
      - 8080:8080


volumes:
  db-data:
  redis-data:
