services:
  analytics-service:
    container_name: analytics-service
    build:
      context: analytics-service
      dockerfile: Dockerfile
    ports:
      - 8080:8080
  analytics-db:
    container_name: analytics-db
    image: postgres:latest
    ports:
      - 5432:5432
    volumes:
      - analytics-db-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=changemelater
      - POSTGRES_USER=analytics_service
      - POSTGRES_DB=analytics_db
  currency-service:
    container_name: currency-service
    build:
      context: currency-service
      dockerfile: Dockerfile
    ports:
      - 8081:8080
  currency-db:
    container_name: currency-db
    image: postgres:latest
    ports:
      - 5433:5432
    volumes:
      - currency-db-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=changemelater
      - POSTGRES_USER=currency_service
      - POSTGRES_DB=currency_db
  transaction-service:
    container_name: transaction-service
    build:
      context: transaction-service
      dockerfile: Dockerfile
    ports:
      - 8082:8080
  transaction-db:
    container_name: transaction-db
    image: postgres:latest
    ports:
      - 5434:5432
    volumes:
      - transaction-db-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=changemelater
      - POSTGRES_USER=transaction_service
      - POSTGRES_DB=transaction_db
  user-service:
    container_name: user-service
    build:
      context: user-service
      dockerfile: Dockerfile
    ports:
      - 8083:8080
  user-db:
    container_name: user-db
    image: postgres:latest
    ports:
      - 5435:5432
    volumes:
      - user-db-data:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=changemelater
      - POSTGRES_USER=user_service
      - POSTGRES_DB=user_db
  database-fe:
    image: adminer:standalone
    restart: always
    ports:
      - "8084:8080"
    environment:
      ADMINER_DESIGN: pepa-linha
volumes:
  analytics-db-data: { }
  user-db-data: { }
  currency-db-data: { }
  transaction-db-data: { }
